Commit 09b80975 authored by VanillaSalt's avatar VanillaSalt

tweak

parent 10a8cfe6
...@@ -62,7 +62,7 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) { ...@@ -62,7 +62,7 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
hints.ai_socktype = SOCK_STREAM; hints.ai_socktype = SOCK_STREAM;
hints.ai_protocol = IPPROTO_TCP; hints.ai_protocol = IPPROTO_TCP;
hints.ai_flags = EVUTIL_AI_ADDRCONFIG; hints.ai_flags = EVUTIL_AI_ADDRCONFIG;
int status=evutil_getaddrinfo(hostname, port, &hints, &answer); int status = evutil_getaddrinfo(hostname, port, &hints, &answer);
if(status != 0) { if(status != 0) {
mainGame->gMutex.Lock(); mainGame->gMutex.Lock();
mainGame->env->addMessageBox(L"", dataManager.GetSysString(1412)); mainGame->env->addMessageBox(L"", dataManager.GetSysString(1412));
......
...@@ -78,12 +78,14 @@ void SingleDuel::JoinGame(DuelPlayer* dp, void* pdata, bool is_creater) { ...@@ -78,12 +78,14 @@ void SingleDuel::JoinGame(DuelPlayer* dp, void* pdata, bool is_creater) {
if(!players[0] || !players[1]) { if(!players[0] || !players[1]) {
STOC_HS_PlayerEnter scpe; STOC_HS_PlayerEnter scpe;
BufferIO::CopyWStr(dp->name, scpe.name, 20); BufferIO::CopyWStr(dp->name, scpe.name, 20);
if(players[0]) { if(!players[0])
scpe.pos = 0;
else
scpe.pos = 1; scpe.pos = 1;
if(players[0]) {
NetServer::SendPacketToPlayer(players[0], STOC_HS_PLAYER_ENTER, scpe); NetServer::SendPacketToPlayer(players[0], STOC_HS_PLAYER_ENTER, scpe);
} }
if(players[1]) { if(players[1]) {
scpe.pos = 0;
NetServer::SendPacketToPlayer(players[1], STOC_HS_PLAYER_ENTER, scpe); NetServer::SendPacketToPlayer(players[1], STOC_HS_PLAYER_ENTER, scpe);
} }
for(auto pit = observers.begin(); pit != observers.end(); ++pit) for(auto pit = observers.begin(); pit != observers.end(); ++pit)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment