Skilled Illusionist
- Joined
- Jul 4, 2009
- Messages
- 363
- Reaction score
- 65
Re: RELEASE63-201405071257-197450526 - PlusR2
Missing packet.....
What's that for?
Missing packet.....
Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!
Join Today!What's that for?
Missing packet.....
Can't Create a Room or Can't Enter Old Rooms =P
Can't Create a Room or Can't Enter Old Rooms =P
Look in the release section!Sorry cms and db compatible ????
Only this time then ;sim italian please link you????
internal void CreateRoom()
{
// New structure fixed by Finn
string Name = this.Request.PopFixedString();
string Description = this.Request.PopFixedString();
string RoomModel = this.Request.PopFixedString();
int Category = this.Request.PopWiredInt32();
int MaxVisitors = this.Request.PopWiredInt32();
int TradeState = this.Request.PopWiredInt32();
RoomData Data = SilverwaveEnvironment.GetGame().GetRoomManager().CreateRoom(this.Session, Name, Description, RoomModel, Category, MaxVisitors);
if (Data != null)
{
this.Response.Init(Outgoing.OnCreateRoomInfo);
this.Response.AppendInt32(Data.Id);
this.Response.AppendString(Data.Name);
this.SendResponse();
}
}
internal RoomData CreateRoom(GameClient Session, string Name, string Desc, string Model, int Category, int MaxVisitors)
{
// New structure fixed by Finn
if (!this.roomModels.ContainsKey(Model))
{
Session.SendNotif("Room Model was not found.");
return null;
}
if (Name.Length < 3)
{
Session.SendNotif("The Room name is too short...");
return null;
}
uint RoomId = 0;
using (IQueryAdapter dbClient = SilverwaveEnvironment.GetDatabaseManager().getQueryreactor())
{
dbClient.setQuery("INSERT INTO rooms (roomtype,caption,description,owner,model_name,category,users_max) VALUES ('private', @[I][B][URL="http://forum.ragezone.com/members/482331.html"]Caption[/URL][/B][/I] , @[I][B][URL="http://forum.ragezone.com/members/275999.html"]des[/URL][/B][/I]c , @[I][B][URL="http://forum.ragezone.com/members/411303.html"]username[/URL][/B][/I] , @[I][B][URL="http://forum.ragezone.com/members/1333478952.html"]model[/URL][/B][/I] , @[I][B][URL="http://forum.ragezone.com/members/1333417018.html"]cat[/URL][/B][/I] , @usmax)");
dbClient.addParameter("caption", Name);
dbClient.addParameter("desc", Desc);
dbClient.addParameter("username", Session.GetHabbo().Username);
dbClient.addParameter("model", Model);
dbClient.addParameter("cat", Category);
dbClient.addParameter("usmax", MaxVisitors);
RoomId = (uint)dbClient.insertQuery();
}
RoomData Data = this.GenerateRoomData(RoomId);
Session.GetHabbo().UsersRooms.Add(Data);
return Data;
}
[B]ServerMessage Message = new ServerMessage(Outgoing.HeightMap);
Message.AppendBoolean(false);[/B]
[B]Message.AppendInt32(-1);[/B] // Walls height, new structure fixed by Finn
public function _-3z7(_arg1:String, _arg2:int, _arg3:int, _arg4:Array, _arg5:Dictionary):void {
var k:ChatRecordData;
var k:_-39d;
var k:Boolean;
var k:int;
var k:int;
var k:_-39d;
if (this._disposed)
{
return;
};
if ((((_arg2 == WindowTracker._-33U)) && (!((_arg3 == this._-63p._-4Un)))))
{
return;
};
if (_arg2 == WindowTracker._-3Kf)
{
};
for each (k in _arg4)
{
for each (k in k.chatlog)
{
k = true;
k = -1;
k = 0;
while (k < this._-1V6.length)
{
k = this._-1V6[k];
if (k._-4wf == k._-4wf)
{
k = false;
break;
};
if ((((k == -1)) && ((k._-1cA < k._-1cA))))
{
break;
};
k++;
};
if (k)
{
if (k == -1)
{
this._-1V6.push(k);
} else
{
this._-1V6.splice(k, 0, k);
};
};
};
};
this._-4SH();
}
internal static ServerMessage SerializeRoomChatlog(uint roomID)
{
// NEW CHATLOGS [March 2014] Coded by Finn
// Please don't remove credits, this took me some time to do... :(
// Credits to Itachi for the structure's "context" enigma :D
ServerMessage Message = new ServerMessage();
RoomData Room = SilverwaveEnvironment.GetGame().GetRoomManager().GenerateRoomData(roomID);
if (Room == null)
{
throw new NullReferenceException("No room found.");
}
Message.Init(Outgoing.RoomChatlog);
Message.AppendByte(1);
Message.AppendShort(2);
Message.AppendString("roomName");
Message.AppendByte(2);
Message.AppendString(Room.Name);
Message.AppendString("roomId");
Message.AppendByte(1);
Message.AppendInt32(Room.Id);
Message.AppendShort(Room.RoomChat.Count);
Room.RoomChat.Reverse();
foreach (Chatlog Log in Room.RoomChat)
{
Habbo Habbo = SilverwaveEnvironment.getHabboForId(Log.UserId);
DateTime Date = SilverwaveEnvironment.UnixToDateTime(Log.Timestamp);
if (Habbo == null)
{
Message.AppendInt32((DateTime.Now - Date).Seconds);
Message.AppendInt32(Log.UserId);
Message.AppendString("*User not found*");
Message.AppendString(Log.Message);
Message.AppendBoolean(true);
}
else
{
Message.AppendInt32((DateTime.Now - Date).Seconds);
Message.AppendInt32(Habbo.Id);
Message.AppendString(Habbo.Username);
Message.AppendString(Log.Message);
Message.AppendBoolean(false); // Text is bold
}
}
Room.RoomChat.Reverse();
return Message;
}
public void AppendByte(int i)
{
this.AppendBytes(new byte[] { (byte)i }, false);
}
Okay guys here is the fix for chatlogs, since everyone is lazy ..
Find: internal static ServerMessage SerializeRoomChatlog
Replace the whole function with:
Code:internal static ServerMessage SerializeRoomChatlog(uint roomID) { // NEW CHATLOGS [March 2014] Coded by Finn // Please don't remove credits, this took me some time to do... :( // Credits to Itachi for the structure's "context" enigma :D ServerMessage Message = new ServerMessage(); RoomData Room = SilverwaveEnvironment.GetGame().GetRoomManager().GenerateRoomData(roomID); if (Room == null) { throw new NullReferenceException("No room found."); } Message.Init(Outgoing.RoomChatlog); Message.AppendByte(1); Message.AppendShort(2); Message.AppendString("roomName"); Message.AppendByte(2); Message.AppendString(Room.Name); Message.AppendString("roomId"); Message.AppendByte(1); Message.AppendInt32(Room.Id); Message.AppendShort(Room.RoomChat.Count); Room.RoomChat.Reverse(); foreach (Chatlog Log in Room.RoomChat) { Habbo Habbo = SilverwaveEnvironment.getHabboForId(Log.UserId); DateTime Date = SilverwaveEnvironment.UnixToDateTime(Log.Timestamp); if (Habbo == null) { Message.AppendInt32((DateTime.Now - Date).Seconds); Message.AppendInt32(Log.UserId); Message.AppendString("*User not found*"); Message.AppendString(Log.Message); Message.AppendBoolean(true); } else { Message.AppendInt32((DateTime.Now - Date).Seconds); Message.AppendInt32(Habbo.Id); Message.AppendString(Habbo.Username); Message.AppendString(Log.Message); Message.AppendBoolean(false); // Text is bold } } Room.RoomChat.Reverse(); return Message; }
EDIT:
Ow, I forgot!!!!!!!
Add to ServerMessage.cs :
Code:public void AppendByte(int i) { this.AppendBytes(new byte[] { (byte)i }, false); }
Screen:
don't forgot to give Rep++ ;D
fix habbo club pls? and bubble color chat not change color
It's best if we just give him time. Some people doesn't like to keep getting messages about to post fixes.
List rooms
int userId = readint
string userName = readstring
int roomsNumber = readint
rooms = new list(roomsNumber)
int roomsCounter =0;
while(roomsCounter < roomsNumber)
{
//Chat Record Data
//Notice that each ChatRecordData has it's own context and chatlog
//For every room that the user has been you will have a ChatRecordData
//Appending a post from a group forum is a possibility (they have website forums)
new hashtable context // must be hashtable;
new List<Chatlogs> chatlogs
byte chatDataType = readbyte //0-4
// type 0 = nothing
// type 1 = roomChatlog
// type 2 = IM Session : Internal mods chat ?
// type 3 = Forum Thread
// type 4 = Forum Message : Website forum or group forum ?
// Notice that both in-game chat messages and forum messages will look the same client-side speaking
// There is a in-game tool in which the mod can delete a forum post or thread
// A mod cannot delete a room chatlog in oposite to forum messages
short contextNumber = readshort
short contextCounter = 0;
while(contextCounter < contextNumber)
{
string contextKey = readstring
// keys: {roomName,groupId,threadId,messageId,roomId}
int contextDataType = (int)readbyte
switch(contextDataType)
{
case 0:
context[contextKey] = readbool
break
case 1:
context[contextKey] = readint
break
case 2:
context[contextKey] = readstring
break
deafult:
Unknown data type
}
k++;
}
//finally, you append the chatlog list
//Each context data is associed to only one chatlog list
int chatlogsNumber = (int)readshort // 0-65535
int chatlogsCounter = 0;
while(chatlogsCounter < chatlogsNumber)
{
//notice that you are appending the chat for everyone in the room/thread
//if the userId is the same as the reported user that you are browing, the chat color should change
int timestamp = readint
int userId = readint //0 if 'bot/pet'
string userName = readstring
string message = readstring
bool colorBool = readbool //defines a color for something. Must test
k++
}
roomsCounter++
}
Complete reversed chatlog, might be usefull
Code:List rooms int userId = readint string userName = readstring int roomsNumber = readint rooms = new list(roomsNumber) int roomsCounter =0; while(roomsCounter < roomsNumber) { //Chat Record Data //Notice that each ChatRecordData has it's own context and chatlog //For every room that the user has been you will have a ChatRecordData //Appending a post from a group forum is a possibility (they have website forums) new hashtable context // must be hashtable; new List<Chatlogs> chatlogs byte chatDataType = readbyte //0-4 // type 0 = nothing // type 1 = roomChatlog // type 2 = IM Session : Internal mods chat ? // type 3 = Forum Thread // type 4 = Forum Message : Website forum or group forum ? // Notice that both in-game chat messages and forum messages will look the same client-side speaking // There is a in-game tool in which the mod can delete a forum post or thread // A mod cannot delete a room chatlog in oposite to forum messages short contextNumber = readshort short contextCounter = 0; while(contextCounter < contextNumber) { string contextKey = readstring // keys: {roomName,groupId,threadId,messageId,roomId} int contextDataType = (int)readbyte switch(contextDataType) { case 0: context[contextKey] = readbool break case 1: context[contextKey] = readint break case 2: context[contextKey] = readstring break deafult: Unknown data type } k++; } //finally, you append the chatlog list //Each context data is associed to only one chatlog list int chatlogsNumber = (int)readshort // 0-65535 int chatlogsCounter = 0; while(chatlogsCounter < chatlogsNumber) { //notice that you are appending the chat for everyone in the room/thread //if the userId is the same as the reported user that you are browing, the chat color should change int timestamp = readint int userId = readint //0 if 'bot/pet' string userName = readstring string message = readstring bool colorBool = readbool //defines a color for something. Must test k++ } roomsCounter++ }