- Joined
- Apr 26, 2011
- Messages
- 403
JASS:
private player cp = Player(0) // Red Player
///Returns first *REAL* player from player 1-12
private function emitter takes nothing returns player
local integer i = GetPlayerId(cp)
loop
set cp = Player(i)
exitwhen GetPlayerController(cp) == MAP_CONTROL_USER and GetPlayerSlotState(cp) == PLAYER_SLOT_STATE_PLAYING
set i = i + 1
endloop
return cp
endfunction
// Places meta-data in the replay and in network traffic
// only one player need to sync the data.
private function emit takes string message returns nothing
local string id = MISSION_KEY_PREFIX + I2S(num_msg)
set num_msg = num_msg + 1
call StoreInteger(gc, id, message, SUFFIX_VAL)
if GetLocalPlayer() == emitter() then
call SyncStoredInteger(gc, id, message)
endif
call FlushStoredInteger(gc, id, message)
endfunction
if I disable above code, desync won't happen.
if I enable, it will only happen when someone leave.
and it do not happen all time. (at lease not happen when host have good connection)
if it happen, then it will cause mass disconnect.
so either normal or mass disconnect
I am not sure why it happen