Exemple #1
0
    // ---------------------------------------------------------------- //
    // 통신 처리 함수.

    //
    public void OnReceiveSyncGamePacket(PacketId id, byte[] data)
    {
        Debug.Log("Receive GameSyncPacket.[TitleControl]");

        SyncGamePacket packet = new SyncGamePacket(data);
        SyncGameData   sync   = packet.GetPacket();

        for (int i = 0; i < sync.itemNum; ++i)
        {
            string log = "[CLIENT] Sync item pickedup " +
                         "itemId:" + sync.items[i].itemId +
                         " state:" + sync.items[i].state +
                         " ownerId:" + sync.items[i].ownerId;
            Debug.Log(log);

            ItemManager.ItemState istate = new ItemManager.ItemState();

            // 아이템의 상태를 매니저에 등록.
            istate.item_id = sync.items[i].itemId;
            istate.state   = (ItemController.State)sync.items[i].state;
            istate.owner   = sync.items[i].ownerId;

            if (GlobalParam.get().item_table.ContainsKey(istate.item_id))
            {
                GlobalParam.get().item_table.Remove(istate.item_id);
            }
            GlobalParam.get().item_table.Add(istate.item_id, istate);
        }

        isReceiveSyncGameData = true;
    }
Exemple #2
0
    public void OnReceiveSyncGamePacket(PacketId id, byte[] data)
    {
        SyncGamePacket packet   = new SyncGamePacket(data);
        SyncGameData   syncGame = packet.GetPacket();

        setSeed(syncGame.randomSeed);
        isPlayer1 = false;
        SceneManager.LoadScene("Hong");
    }
Exemple #3
0
    public void OnReceiveSyncGamePacket(PacketId id, byte[] data)
    {
        Debug.Log("Receive GameSyncPacket[CharacterRoot].");

        SyncGamePacket packet = new SyncGamePacket(data);
        SyncGameData   sync   = packet.GetPacket();

        Debug.Log("[CharId]" + sync.moving.characterId);
        Debug.Log("[HouseName]" + sync.moving.houseId);
        Debug.Log("[Moving]" + sync.moving.moving);

        if (sync.moving.characterId.Length == 0)
        {
            // 이사하지 않았다.
            return;
        }

        // 이사 정보 보존.
        GlobalParam.get().remote_moving = sync.moving;
    }
Exemple #4
0
	// ---------------------------------------------------------------- //
	// 통신 처리 함수.

	// 
	public void OnReceiveSyncGamePacket(PacketId id, byte[] data)
	{
		Debug.Log("Receive GameSyncPacket.[TitleControl]");
		
		SyncGamePacket packet = new SyncGamePacket(data);
		SyncGameData sync = packet.GetPacket();
		
		for (int i = 0; i < sync.itemNum; ++i) {
			string log = "[CLIENT] Sync item pickedup " +
				"itemId:" + sync.items[i].itemId +
					" state:" + sync.items[i].state + 
					" ownerId:" + sync.items[i].ownerId;
			Debug.Log(log);
			
			ItemManager.ItemState istate = new ItemManager.ItemState();
			
			// 아이템의 상태를 매니저에 등록.
			istate.item_id = sync.items[i].itemId;
			istate.state = (ItemController.State) sync.items[i].state;
			istate.owner = sync.items[i].ownerId;
			
			if (GlobalParam.get().item_table.ContainsKey(istate.item_id)) {
				GlobalParam.get().item_table.Remove(istate.item_id);
			}
			GlobalParam.get().item_table.Add(istate.item_id, istate);
		}

		isReceiveSyncGameData = true;
	}