Skip to content

Commit

Permalink
Merge pull request #4 from eithwa/networking
Browse files Browse the repository at this point in the history
Networking
  • Loading branch information
eithwa authored Mar 5, 2020
2 parents 93f2be6 + 78b1171 commit 93f41d7
Show file tree
Hide file tree
Showing 19 changed files with 629 additions and 67 deletions.
101 changes: 101 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@

# StepMania 3.9 永和金城武版(YHANIKI)
+ fork from [stepmania](https://github.com/stepmania/stepmania)
- [tag v390release](https://github.com/stepmania/stepmania/releases/tag/v390release)
+ 部分功能沿用ddrtime編輯器版本StepMania
- [STEPMANIA 3.9 編輯器我流版](https://forum.gamer.com.tw/C.php?bsn=16862&snA=1184)
<!-- TOC -->

- [StepMania 3.9 永和金城武版(YHANIKI)](#stepmania-39-%e6%b0%b8%e5%92%8c%e9%87%91%e5%9f%8e%e6%ad%a6%e7%89%88yhaniki)
- [一般模式](#%e4%b8%80%e8%88%ac%e6%a8%a1%e5%bc%8f)
- [作譜模式](#%e4%bd%9c%e8%ad%9c%e6%a8%a1%e5%bc%8f)
- [連線模式](#%e9%80%a3%e7%b7%9a%e6%a8%a1%e5%bc%8f)
- [其他](#%e5%85%b6%e4%bb%96)
- [TODO](#todo)
- [偉大貢獻者](#%e5%81%89%e5%a4%a7%e8%b2%a2%e7%8d%bb%e8%80%85)

<!-- /TOC -->
## 一般模式
+ 快速鍵
- F4 更新指定歌曲
- F5 快速重讀歌曲
- Ctrl + F5 指定資料夾快速重讀歌曲
+ note流速不因歌曲倍速改變
+ 結算成績畫面顯示歌曲倍速
+ 修正使用AUTOPLAY或譜面無note會崩潰的問題
+ hold結尾改為TNS_MARVELOUS(白光)
+ 影片速度根據歌曲倍速改變
+ combo數字圖層上移
+ 遊戲大廳Note數改為顯示總按鍵數(原本為Tap + Hold)

## 作譜模式
+ ddrtime
- BPM與STOP顯示最小可到小數點第三位
- 右上方BEAT與時間顯示可到小數點第六位(特殊用)
- 箭頭間距拉伸變更成以0.5倍為單位,範圍可到0.25x~8x
若想整數拉伸可用ctrl+pageup與ctrl+pagedown鍵控制
- STEP停拍可以變負數
- 增加N鍵直接轉換負數功能,直接按N鍵會建立一個BPM標籤
CTRL+N會直接轉換BPM為負數,ALT+N會直接轉換STOP為負數
- 支援192nd箭頭編輯
- 增加直接編輯BPM與STOP功能
- 可追朔以前的備份
(編輯的歌曲資料夾會多個FileBackup資料夾,並以時間戳記為檔案名稱)
- 自動儲存 (可選擇你要儲存的時間間隔,也可以關閉,預設自動儲存時間是5分鐘)
- Reverse逆流編輯環境下可直覺操作
- Reverse逆流編輯直覺操作性可在Preferences下的Reverse Control Intuitive更改
- 增加DisplayBPM編輯,可在Edit Song Info下找到
+ 另外增加
- 影片預覽撥放位置修正
- 變速結尾bpm錯誤修正
- 變速長條截斷修正
- 開啟PlayerOptions, SongOptions 譜面還原問題修改(SONGMAN->Cleanup(); ignore)
- 多段變速bpm修正
- 多難度停拍位置修正
- 測試前緩衝調整選項(Preferences->play mode beats buffer)
- 顯示歌曲背景功能加上黑色遮罩(alpha0.5)

## 連線模式
+ 快速鍵
- F1 重讀connect資料夾
- F4 跳到當前選擇歌曲
- F5 快速重讀歌曲
- F8 開關玩家狀態
- 同時按左右切換一般模式選歌
+ 指令
- /list 顯示玩家編號與名稱
- /host 玩家名稱或玩家編號 更換房主
- /share 玩家編號 傳送歌曲(過濾影片)
- /sharefull 玩家編號 傳送歌曲(包含影片)
+ 缺歌檔案傳送功能(/share /sharefull)
+ 修正CyberiaStyle 6連線模式無法顯示玩家名稱問題
+ 修正歌包跳回ALL GROUPS問題
+ 修正歌曲難度排序問題
+ 結算成績畫面傳送玩家百分比
+ 結算成績畫面傳送玩家血量graph
+ 遊戲強制變更為不關門模式
+ StandAloneServer(獨立執行伺服器)
+ 選擇曲目相同性判斷(判斷譜面按鍵數)
+ 大廳顯示玩家狀態
+ 不是置中的玩家,在遊戲中玩家成績列表會往上顯示

## 其他
+ 修正options玩家變更名稱錯誤問題
+ options選預設charater(options->background options->danceing characters->static)
+ 增加使用右邊數字鍵輸入數字功能
+ options語言ini紀錄儲存
+ 修正ScreenDemonstration無歌曲崩潰問題

## TODO
+ 增加hold結尾判定模式
+ 打擊軌道背板
+ 遊戲輸入中文
+ 連線模式 大廳顯示歌曲背景
+ 連線模式 玩家聊天時顯示編號

## 偉大貢獻者
+ MKLUO
+ 151
+ sky
+ Ameto

12 changes: 10 additions & 2 deletions src/ArrowEffects.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@ float ArrowGetYOffset( PlayerNumber pn, int iCol, float fNoteBeat )
{
float fSongBeat = GAMESTATE->m_fSongBeat;
float fBeatsUntilStep = fNoteBeat - fSongBeat;
float fYOffsetBeatSpacing = fBeatsUntilStep * ARROW_SPACING/GAMESTATE->m_SongOptions.m_fMusicRate;
float fYOffsetBeatSpacing = fBeatsUntilStep * ARROW_SPACING;
if(GAMESTATE->m_bEditing == false)
{
fYOffsetBeatSpacing = fBeatsUntilStep * ARROW_SPACING/GAMESTATE->m_SongOptions.m_fMusicRate;
}
fYOffset += fYOffsetBeatSpacing * (1-GAMESTATE->m_CurrentPlayerOptions[pn].m_fTimeSpacing);
}

Expand All @@ -40,7 +44,11 @@ float ArrowGetYOffset( PlayerNumber pn, int iCol, float fNoteBeat )
float fSecondsUntilStep = fNoteSeconds - fSongSeconds;
float fBPM = GAMESTATE->m_CurrentPlayerOptions[pn].m_fScrollBPM;
float fBPS = fBPM/60.f;
float fYOffsetTimeSpacing = fSecondsUntilStep * fBPS * ARROW_SPACING/GAMESTATE->m_SongOptions.m_fMusicRate;
float fYOffsetTimeSpacing = fSecondsUntilStep * fBPS * ARROW_SPACING;
if(GAMESTATE->m_bEditing == false)
{
fYOffsetTimeSpacing = fSecondsUntilStep * fBPS * ARROW_SPACING/GAMESTATE->m_SongOptions.m_fMusicRate;
}
fYOffset += fYOffsetTimeSpacing * GAMESTATE->m_CurrentPlayerOptions[pn].m_fTimeSpacing;
}

Expand Down
1 change: 1 addition & 0 deletions src/GameState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ GameState* GAMESTATE = NULL; // global and accessable from anywhere in our progr

GameState::GameState()
{
ScreenNetSelectMusicAlpha = 1;
m_pPosition = NULL;
m_pCurStyle = NULL;

Expand Down
2 changes: 1 addition & 1 deletion src/GameState.h
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ class GameState

void ResetStageStatistics(); // Call this when it's time to play a new stage.
void GetFinalEvalStats( StageStats& statsOut ) const; // shown on final evaluation

bool ScreenNetSelectMusicAlpha;

//
// Options stuff
Expand Down
56 changes: 43 additions & 13 deletions src/NetworkSyncManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ unsigned long GetFileLength ( FILE * fileName)
}
NetworkSyncManager::NetworkSyncManager( LoadingWindow *ld )
{
ClientNum=0;
LANserver = NULL; //So we know if it has been created yet
if( GetCommandlineArgument( "runserver" ))
{
Expand Down Expand Up @@ -522,19 +523,19 @@ DWORD NetworkSyncManager::ThreadProcNSSSS(void)
tmp = tmp.substr(0, tmp.size()-1);

string CurrentPath;
size_t size;
char *path=NULL;
path=getcwd(path,size);
CurrentPath=path;
char buf[100];
getcwd(buf, sizeof(buf));
CurrentPath.assign(buf);

// now_SongDir.left(now_SongDir.GetLength()-1);
// LOG->Info("GAMESTATE->m_pCurSong.m_sSongDir %s",tmp.c_str());
string connet_dir = path;
connet_dir +="\\Songs\\connect";
string connet_dir = CurrentPath;
connet_dir +="\\Songs\\connect";
string connect_dir_cmd="mkdir ";
connect_dir_cmd+="\"";
connect_dir_cmd+=connet_dir;
connect_dir_cmd+="\"";
LOG->Info("connect_dir_cmd %s",connect_dir_cmd.c_str());
system(connect_dir_cmd.c_str());//mkdir "C:\\StepMania\\Songs\\connect"
string zip_name = "temp.zip";
string init_cmd = "7za.exe d ";
Expand Down Expand Up @@ -649,12 +650,11 @@ DWORD NetworkSyncManager::ThreadProcNSSSC(void)
LOG->Info("file_size %s",file_size.c_str());

string CurrentPath;
size_t size;
char *path=NULL;
path=getcwd(path,size);
CurrentPath=path;
char buf[100];
getcwd(buf, sizeof(buf));
CurrentPath.assign(buf);

string connet_dir = path;
string connet_dir = CurrentPath;
connet_dir +="\\Songs\\connect";
string connect_dir_cmd="mkdir ";
connect_dir_cmd+="\"";
Expand Down Expand Up @@ -820,6 +820,11 @@ void NetworkSyncManager::ProcessInput()
m_sMainTitle = m_packet.ReadNT();
m_sArtist = m_packet.ReadNT();
m_sSubTitle = m_packet.ReadNT();
int temp_hash = m_packet.Read4();
if(temp_hash!=0)
{
m_ihash = temp_hash;
}
m_sCurMainTitle=m_sMainTitle;
m_sCurArtist=m_sArtist;
m_sCurSubTitle=m_sSubTitle;
Expand Down Expand Up @@ -894,6 +899,16 @@ void NetworkSyncManager::ProcessInput()
}
}
break;
case NSCPC:
{
m_PlayerCondition.clear();
int player_number = m_packet.Read1();
for(int i=0; i<player_number; i++)
{
m_PlayerCondition.push_back(m_packet.Read1());
}
ClientNum = m_packet.Read1();
}
}
m_packet.ClearPacket();
}
Expand Down Expand Up @@ -957,10 +972,25 @@ void NetworkSyncManager::SelectUserSong()
m_packet.WriteNT( m_sMainTitle );
m_packet.WriteNT( m_sArtist );
m_packet.WriteNT( m_sSubTitle );
m_packet.Write4( m_ihash );
NetPlayerClient->SendPack((char*)&m_packet.Data, m_packet.Position);
}
void NetworkSyncManager::SendHasSong(bool hasSong)
{
if(hasSong)
{
m_packet.ClearPacket();
m_packet.Write1( NSCCHS );
m_packet.Write1( 1 );
NetPlayerClient->SendPack((char*)&m_packet.Data, m_packet.Position);
}
}
void NetworkSyncManager::SendAskSong()
{
m_packet.ClearPacket();
m_packet.Write1( NSCAS );
NetPlayerClient->SendPack((char*)&m_packet.Data, m_packet.Position);
}


//Packet functions

uint8_t PacketFunctions::Read1()
Expand Down
11 changes: 9 additions & 2 deletions src/NetworkSyncManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ enum NSCommand
NSCUPPer, //12
NSSSS, //13 share song server
NSSSC, //14
NSCGraph, //15
NSCGraph, //15
NSCPC, //16 player conditions //is the data size enough to use 16?
NSCCHS, //17 checkhassong
NSCAS, //18 ask song
NUM_NS_COMMANDS
};

Expand Down Expand Up @@ -115,6 +118,8 @@ class NetworkSyncManager
int m_ActivePlayers;
vector <int> m_ActivePlayer;
vector <CString> m_PlayerNames;
vector <int> m_PlayerCondition;
int ClientNum;

//Used for ScreenNetEvaluation
EndOfGame_PlayerData m_EvalPlayerData[NETMAXPLAYERS];
Expand All @@ -141,8 +146,10 @@ class NetworkSyncManager
CString m_sCurArtist;
CString m_sCurSubTitle;
int m_iSelectMode;
int m_ihash;
void SelectUserSong();

void SendHasSong(bool hasSong);
void SendAskSong();
CString m_sChatText;

bool isLanServer; //Must be public for ScreenNetworkOptions
Expand Down
Loading

0 comments on commit 93f41d7

Please sign in to comment.