Пример #1
0
        public static void UserJoined(userManager _user, int _roomID)
        {
            Room _room     = getInstance(_roomID);
            User _userInfo = _user.Session.userInfo;
            int  tRoomID   = getGameRoomID(_roomID);

            sendToRoom(_roomID, "<msg t='sys'><body action='uER' r='" + tRoomID + "'><u i='" + _userInfo.userID + "' m='" + _user.isModerator + "' s='0' p='" + _userInfo.playerID + "'><n><![CDATA[" + _userInfo.Username + "]]></n><vars></vars></u></body></msg>");
            sendToRoom(_roomID, "%xt%uotls%-1%" + _userInfo.Username + "%afk:" + _user.isAFK + ",intHP:" + _userInfo.HP + ",strPad:" + _userInfo.Pad + ",intMPMax:" + _userInfo.MaxMP + ",uoName:" + _userInfo.Username + ",tx:" + _userInfo.X + ",ty:" + _userInfo.Y + ",intState:" + _userInfo.State + ",intLevel:" + _userInfo.Level + ",strUsername:"******",intHPMax:" + _userInfo.MaxHP + ",intMP:" + _userInfo.MP + ",strFrame:" + _userInfo.Frame + "%");
        }
Пример #2
0
        public static void UserLeft(userManager _user, int _roomID)
        {
            int  tRoomID = getGameRoomID(_roomID);
            Room _room   = getInstance(_roomID);

            sendToRoom(_roomID, "<msg t='sys'><body action='userGone' r='" + tRoomID + "'><user id='" + _user.Session.userInfo.userID + "' /></body></msg>");
            sendToRoom(_roomID, "%xt%exitArea%-1%" + _user.Session.userInfo.userID + "%");

            _room.RemoveUser(_user.Session.userInfo.userID);
        }
Пример #3
0
        public static string getPlayers(int _roomID)
        {
            int    tRoomID = getGameRoomID(_roomID);
            string ret     = "<uLs r='" + tRoomID + "'>";

            Room _room = getInstance(_roomID);

            foreach (KeyValuePair <int, userManager> KVP in _room.activeUsers)
            {
                userManager _user     = KVP.Value;
                User        _userInfo = _user.Session.userInfo;

                ret += "<u i='" + _userInfo.userID + "' m='" + _user.isModerator + "' s='0' p='" + _userInfo.playerID + "'><n><![CDATA[" + _userInfo.Username + "]]></n><vars></vars></u>";
            }

            ret += "</uLs>";
            return(ret);
        }
Пример #4
0
        public static string getUoBranch(int _roomID)
        {
            string ret       = "[";
            bool   firstTime = true;
            Room   _room     = getInstance(_roomID);

            foreach (KeyValuePair <int, userManager> KVP in _room.activeUsers)
            {
                userManager _user     = KVP.Value;
                User        _userInfo = _user.Session.userInfo;

                if (!firstTime)
                {
                    ret += ",";
                }

                ret += "[\"uoName:" + _userInfo.Username + "\",\"strUsername:"******"\",\"strFrame:" + _userInfo.Frame + "\",\"strPad:" + _userInfo.Pad + "\",\"intState:" + _userInfo.State + "\",\"intLevel:" + _userInfo.Level + "\",\"intHP:" + _userInfo.HP + "\",\"intMP:" + _userInfo.MP + "\",\"intHPMax:" + _userInfo.MaxHP + "\",\"intMPMax:" + _userInfo.MaxMP + "\",\"tx:" + _userInfo.X + "\",\"ty:" + _userInfo.Y + "\",\"afk:" + _user.isAFK + "\"]";

                firstTime = false;
            }
            ret += "]";

            return(ret);
        }
Пример #5
0
 public userSession(userManager Connection, User userInfo)
 {
     this.Connection = Connection;
     this.userInfo = userInfo;
 }
Пример #6
0
        public static void UserLeft(userManager _user, int _roomID)
        {
            int tRoomID = getGameRoomID(_roomID);
            Room _room = getInstance(_roomID);
            sendToRoom(_roomID, "<msg t='sys'><body action='userGone' r='" + tRoomID + "'><user id='" + _user.Session.userInfo.userID + "' /></body></msg>");
            sendToRoom(_roomID, "%xt%exitArea%-1%" + _user.Session.userInfo.userID + "%");

            _room.RemoveUser(_user.Session.userInfo.userID);
        }
Пример #7
0
        public static void UserJoined(userManager _user, int _roomID)
        {
            Room _room = getInstance(_roomID);
            User _userInfo = _user.Session.userInfo;
            int tRoomID = getGameRoomID(_roomID);

            sendToRoom(_roomID, "<msg t='sys'><body action='uER' r='" + tRoomID + "'><u i='" + _userInfo.userID + "' m='" + _user.isModerator + "' s='0' p='" + _userInfo.playerID + "'><n><![CDATA[" + _userInfo.Username + "]]></n><vars></vars></u></body></msg>");
            sendToRoom(_roomID, "%xt%uotls%-1%" + _userInfo.Username + "%afk:" + _user.isAFK + ",intHP:" + _userInfo.HP + ",strPad:" + _userInfo.Pad + ",intMPMax:" + _userInfo.MaxMP + ",uoName:" + _userInfo.Username + ",tx:" + _userInfo.X + ",ty:" + _userInfo.Y + ",intState:" + _userInfo.State + ",intLevel:" + _userInfo.Level + ",strUsername:"******",intHPMax:" + _userInfo.MaxHP + ",intMP:" + _userInfo.MP + ",strFrame:" + _userInfo.Frame + "%");
        }
Пример #8
0
 public Packets(userManager Connection)
 {
     this.Connection = Connection;
 }
Пример #9
0
 public void AddUser(int userID, userManager User)
 {
     if (!activeUsers.ContainsKey(userID))
         activeUsers.Add(userID, User);
 }