1
0
Fork 0
This repository has been archived on 2024-01-06. You can view files and clone it, but cannot push or open issues or pull requests.
MMORPG_PROJECT/Unity network UDP/Assets/scripts/network/packet/MessagePacket.cs
2016-06-22 21:45:43 +02:00

38 lines
769 B
C#

using System;
using UnityEngine;
using System.Collections.Generic;
using System.Linq;
using System.Text;
class MessagePacket : IPacket
{
private String pseudo, message;
public MessagePacket() { }
public MessagePacket(String pseudo, String message)
{
this.message = message;
this.pseudo = pseudo;
}
void IPacket.read(DataBuffer data)
{
this.pseudo = data.getString();
this.message = data.getString();
}
void IPacket.write(DataBuffer data)
{
data.put(Register.getId(typeof(MessagePacket)));
data.put(this.pseudo);
data.put(this.message);
}
void IPacket.manage(byte[] data,Client client)
{
Debug.Log(this.pseudo + " : " + this.message);
}
}