Commit 8f172f57 authored by argon.sun's avatar argon.sun

fix

parent 54fadd0e
......@@ -95,6 +95,17 @@ struct STOC_HS_PlayerChange {
struct STOC_HS_WatchChange {
unsigned short watch_count;
};
struct STOC_HT_PlayerEnter {
unsigned short name[20];
unsigned char pos;
};
struct STOC_HT_PlayerChange {
//pos<<4 | state
unsigned char status;
};
struct STOC_HT_WatchChange {
unsigned short watch_count;
};
class DuelMode;
......@@ -175,11 +186,12 @@ public:
#define CTOS_HS_NOTREADY 0x23
#define CTOS_HS_KICK 0x24
#define CTOS_HS_START 0x25
#define CTOS_HT_CHANGEPOS 0x30
#define CTOS_HT_READY 0x31
#define CTOS_HT_NOTREADY 0x32
#define CTOS_HT_KICK 0x33
#define CTOS_HT_START 0x34
#define CTOS_HT_TODUELIST 0x30
#define CTOS_HT_TOOBSERVER 0x31
#define CTOS_HT_READY 0x32
#define CTOS_HT_NOTREADY 0x33
#define CTOS_HT_KICK 0x34
#define CTOS_HT_START 0x35
#define STOC_GAME_MSG 0x1
#define STOC_ERROR_MSG 0x2
......@@ -203,6 +215,7 @@ public:
#define STOC_HS_WATCH_CHANGE 0x22
#define STOC_HT_PLAYER_ENTER 0x30
#define STOC_HT_PLAYER_CHANGE 0x31
#define STOC_HT_WATCH_CHANGE 0x32
#define PLAYERCHANGE_READY 0x1
#define PLAYERCHANGE_NOTREADY 0x2
......@@ -216,4 +229,5 @@ public:
#define MODE_SINGLE 0x0
#define MODE_MATCH 0x1
#define MODE_TAG 0x2
#endif //NETWORK_H
......@@ -225,6 +225,7 @@ void SingleDuel::ToObserver(DuelPlayer* dp) {
for(auto pit = observers.begin(); pit != observers.end(); ++pit)
NetServer::SendPacketToPlayer(*pit, STOC_HS_PLAYER_CHANGE, scpc);
players[dp->type] = 0;
ready[dp->type] = false;
dp->type = NETPLAYER_TYPE_OBSERVER;
observers.insert(dp);
STOC_TypeChange sctc;
......
This diff is collapsed.
......@@ -44,6 +44,7 @@ public:
protected:
DuelPlayer* players[4];
DuelPlayer* pplayer[4];
std::set<DuelPlayer*> observers;
bool ready[4];
Deck pdeck[4];
unsigned char hand_result[2];
......
......@@ -886,7 +886,8 @@ int32 field::control_adjust(uint16 step) {
pduel->write_buffer32(504);
add_process(PROCESSOR_SELECT_CARD, 0, 0, 0, 1, count + (count << 16));
}
}
} else
core.units.begin()->step = 1;
} else if (core.control_adjust_set[0].size() < core.control_adjust_set[1].size()) {
if(core.control_adjust_set[1].size() - core.control_adjust_set[0].size() > b0) {
if(core.control_adjust_set[0].size() == 0 && b0 == 0) {
......@@ -905,7 +906,8 @@ int32 field::control_adjust(uint16 step) {
pduel->write_buffer32(504);
add_process(PROCESSOR_SELECT_CARD, 0, 0, 0, 0, count + (count << 16));
}
}
} else
core.units.begin()->step = 1;
} else
core.units.begin()->step = 1;
return FALSE;
......
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