Beispiel #1
0
    public void OnReceivePrizePacket(int node, PacketId id, byte[] data)
    {
        PrizePacket packet = new PrizePacket(data);
        PrizeData   prize  = packet.GetPacket();

        int gid = getGlobalIdFromName(prize.characterId);

        string log = "[SERVER] Recv prize Packet[" + prize.characterId + "]:" + prize.cakeNum;

        Debug.Log(log);

        if (gid < 0)
        {
            return;
        }

        prizeNum[gid] = prize.cakeNum;

        // 케이크 획득 정보 감시 시작.
        isRecvPrize = true;
    }
Beispiel #2
0
    // ---------------------------------------------------------------- //
    // 케이트 데이터 송수신.

    private void sendPrizeData()
    {
        PrizeData data = new PrizeData();

        chrBehaviorLocal local_player = PartyControl.get().getLocalPlayer();

        Debug.Log("[CLIENT] sendPrizeData");

        // 획득한 케이크 수를 설정.
        data.characterId = local_player.getAcountID();
        data.cakeNum     = local_player.getCakeCount();

        if (this.m_network != null)
        {
            PrizePacket packet = new PrizePacket(data);

            int serverNode = this.m_network.GetServerNode();
            this.m_network.SendReliable <PrizeData>(serverNode, packet);

            Debug.Log("[CLIENT] send cake num[" + data.characterId + "]:" + data.cakeNum);
        }
    }
Beispiel #3
0
	public void OnReceivePrizePacket(int node, PacketId id, byte[] data)
	{
		PrizePacket packet = new PrizePacket (data);
		PrizeData prize = packet.GetPacket ();

		int gid = getGlobalIdFromName(prize.characterId);

		string log = "[SERVER] Recv prize Packet[" + prize.characterId + "]:" + prize.cakeNum;
		Debug.Log(log);

		if (gid < 0) {
			return;
		}

		prizeNum[gid] = prize.cakeNum;

		// 케이크 획득 정보 감시 시작.
		isRecvPrize = true;
	}
	// ---------------------------------------------------------------- //
	// 케이트 데이터 송수신.

	private void sendPrizeData()
	{
		PrizeData data = new PrizeData ();
		
		chrBehaviorLocal	local_player = PartyControl.get().getLocalPlayer();
		
		Debug.Log("[CLIENT] sendPrizeData");
		
		// 획득한 케이크 수를 설정.
		data.characterId = local_player.getAcountID();
		data.cakeNum = local_player.getCakeCount();
		
		if (this.m_network != null) {
			PrizePacket packet = new PrizePacket (data);
			
			int serverNode = this.m_network.GetServerNode();
			this.m_network.SendReliable<PrizeData>(serverNode, packet);
			
			Debug.Log("[CLIENT] send cake num[" + data.characterId + "]:" + data.cakeNum);
		}
	}