mirror of
https://github.com/ProjectSWGCore/NGECore2.git
synced 2026-10-04 19:12:50 -04:00
Merge branch 'master' of https://github.com/ProjectSWGCore/NGECore2
This commit is contained in:
@@ -43,7 +43,7 @@ import org.apache.mina.core.session.IoSession;
|
||||
import com.sleepycat.je.Transaction;
|
||||
import com.sleepycat.persist.EntityCursor;
|
||||
|
||||
import protocol.swg.ChatSystemMessage;
|
||||
import protocol.swg.chat.ChatSystemMessage;
|
||||
import net.engio.mbassy.bus.config.BusConfiguration;
|
||||
import resources.common.RadialOptions;
|
||||
import resources.common.ThreadMonitor;
|
||||
|
||||
@@ -24,6 +24,7 @@ package protocol.swg;
|
||||
import java.nio.ByteBuffer;
|
||||
|
||||
import protocol.Message;
|
||||
import protocol.swg.chat.ChatInstantMessageToCharacter;
|
||||
|
||||
|
||||
public class SWGMessageFactory {
|
||||
|
||||
@@ -19,10 +19,12 @@
|
||||
* Using NGEngine to work with NGECore2 is making a combined work based on NGEngine.
|
||||
* Therefore all terms and conditions of the GNU Lesser General Public License cover the combination.
|
||||
******************************************************************************/
|
||||
package protocol.swg;
|
||||
package protocol.swg.chat;
|
||||
|
||||
import org.apache.mina.core.buffer.IoBuffer;
|
||||
|
||||
import protocol.swg.SWGMessage;
|
||||
|
||||
|
||||
public class ChatCreateRoom extends SWGMessage {
|
||||
|
||||
+3
-1
@@ -19,10 +19,12 @@
|
||||
* Using NGEngine to work with NGECore2 is making a combined work based on NGEngine.
|
||||
* Therefore all terms and conditions of the GNU Lesser General Public License cover the combination.
|
||||
******************************************************************************/
|
||||
package protocol.swg;
|
||||
package protocol.swg.chat;
|
||||
|
||||
import org.apache.mina.core.buffer.IoBuffer;
|
||||
|
||||
import protocol.swg.SWGMessage;
|
||||
|
||||
|
||||
public class ChatDeletePersistentMessage extends SWGMessage {
|
||||
|
||||
+2
-2
@@ -19,10 +19,11 @@
|
||||
* Using NGEngine to work with NGECore2 is making a combined work based on NGEngine.
|
||||
* Therefore all terms and conditions of the GNU Lesser General Public License cover the combination.
|
||||
******************************************************************************/
|
||||
package protocol.swg;
|
||||
package protocol.swg.chat;
|
||||
|
||||
import org.apache.mina.core.buffer.IoBuffer;
|
||||
|
||||
import protocol.swg.SWGMessage;
|
||||
import resources.common.StringUtilities;
|
||||
|
||||
public class ChatEnterRoomById extends SWGMessage {
|
||||
@@ -34,7 +35,6 @@ public class ChatEnterRoomById extends SWGMessage {
|
||||
|
||||
@Override
|
||||
public void deserialize(IoBuffer data) {
|
||||
StringUtilities.printBytes(data.array());
|
||||
data.getShort();
|
||||
data.getInt();
|
||||
|
||||
+3
-1
@@ -1,4 +1,4 @@
|
||||
package protocol.swg;
|
||||
package protocol.swg.chat;
|
||||
|
||||
import java.nio.ByteOrder;
|
||||
|
||||
@@ -6,6 +6,8 @@ import main.NGECore;
|
||||
|
||||
import org.apache.mina.core.buffer.IoBuffer;
|
||||
|
||||
import protocol.swg.SWGMessage;
|
||||
|
||||
public class ChatFriendsListUpdate extends SWGMessage {
|
||||
|
||||
private String friendName;
|
||||
+3
-1
@@ -19,13 +19,15 @@
|
||||
* Using NGEngine to work with NGECore2 is making a combined work based on NGEngine.
|
||||
* Therefore all terms and conditions of the GNU Lesser General Public License cover the combination.
|
||||
******************************************************************************/
|
||||
package protocol.swg;
|
||||
package protocol.swg.chat;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.nio.ByteBuffer;
|
||||
|
||||
import org.apache.mina.core.buffer.IoBuffer;
|
||||
|
||||
import protocol.swg.SWGMessage;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
|
||||
public class ChatInstantMessageToCharacter extends SWGMessage {
|
||||
+3
-1
@@ -19,12 +19,14 @@
|
||||
* Using NGEngine to work with NGECore2 is making a combined work based on NGEngine.
|
||||
* Therefore all terms and conditions of the GNU Lesser General Public License cover the combination.
|
||||
******************************************************************************/
|
||||
package protocol.swg;
|
||||
package protocol.swg.chat;
|
||||
|
||||
import java.nio.ByteOrder;
|
||||
|
||||
import org.apache.mina.core.buffer.IoBuffer;
|
||||
|
||||
import protocol.swg.SWGMessage;
|
||||
|
||||
|
||||
public class ChatInstantMessagetoClient extends SWGMessage{
|
||||
|
||||
@@ -19,12 +19,14 @@
|
||||
* Using NGEngine to work with NGECore2 is making a combined work based on NGEngine.
|
||||
* Therefore all terms and conditions of the GNU Lesser General Public License cover the combination.
|
||||
******************************************************************************/
|
||||
package protocol.swg;
|
||||
package protocol.swg.chat;
|
||||
|
||||
import java.nio.ByteOrder;
|
||||
|
||||
import org.apache.mina.core.buffer.IoBuffer;
|
||||
|
||||
import protocol.swg.SWGMessage;
|
||||
|
||||
public class ChatOnAddFriend extends SWGMessage {
|
||||
|
||||
@Override
|
||||
+2
-1
@@ -19,7 +19,7 @@
|
||||
* Using NGEngine to work with NGECore2 is making a combined work based on NGEngine.
|
||||
* Therefore all terms and conditions of the GNU Lesser General Public License cover the combination.
|
||||
******************************************************************************/
|
||||
package protocol.swg;
|
||||
package protocol.swg.chat;
|
||||
|
||||
import java.nio.ByteOrder;
|
||||
|
||||
@@ -27,6 +27,7 @@ import main.NGECore;
|
||||
|
||||
import org.apache.mina.core.buffer.IoBuffer;
|
||||
|
||||
import protocol.swg.SWGMessage;
|
||||
import engine.resources.config.Config;
|
||||
|
||||
public class ChatOnChangeFriendStatus extends SWGMessage {
|
||||
@@ -0,0 +1,48 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2013 <Project SWG>
|
||||
*
|
||||
* This File is part of NGECore2.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Using NGEngine to work with NGECore2 is making a combined work based on NGEngine.
|
||||
* Therefore all terms and conditions of the GNU Lesser General Public License cover the combination.
|
||||
******************************************************************************/
|
||||
package protocol.swg.chat;
|
||||
|
||||
import java.nio.ByteOrder;
|
||||
|
||||
import org.apache.mina.core.buffer.IoBuffer;
|
||||
|
||||
import protocol.swg.SWGMessage;
|
||||
|
||||
public class ChatOnConnectAvatar extends SWGMessage {
|
||||
|
||||
public ChatOnConnectAvatar() { }
|
||||
|
||||
@Override
|
||||
public void deserialize(IoBuffer data) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public IoBuffer serialize() {
|
||||
IoBuffer buffer = IoBuffer.allocate(6).order(ByteOrder.LITTLE_ENDIAN);
|
||||
|
||||
buffer.putShort((short) 1);
|
||||
buffer.putInt(0xD72FE9BE);
|
||||
|
||||
return buffer.flip();
|
||||
}
|
||||
|
||||
}
|
||||
+2
-1
@@ -19,7 +19,7 @@
|
||||
* Using NGEngine to work with NGECore2 is making a combined work based on NGEngine.
|
||||
* Therefore all terms and conditions of the GNU Lesser General Public License cover the combination.
|
||||
******************************************************************************/
|
||||
package protocol.swg;
|
||||
package protocol.swg.chat;
|
||||
|
||||
import java.nio.ByteOrder;
|
||||
|
||||
@@ -27,6 +27,7 @@ import main.NGECore;
|
||||
|
||||
import org.apache.mina.core.buffer.IoBuffer;
|
||||
|
||||
import protocol.swg.SWGMessage;
|
||||
import services.chat.ChatRoom;
|
||||
|
||||
public class ChatOnCreateRoom extends SWGMessage {
|
||||
+2
-1
@@ -19,7 +19,7 @@
|
||||
* Using NGEngine to work with NGECore2 is making a combined work based on NGEngine.
|
||||
* Therefore all terms and conditions of the GNU Lesser General Public License cover the combination.
|
||||
******************************************************************************/
|
||||
package protocol.swg;
|
||||
package protocol.swg.chat;
|
||||
|
||||
import java.nio.ByteOrder;
|
||||
|
||||
@@ -27,6 +27,7 @@ import main.NGECore;
|
||||
|
||||
import org.apache.mina.core.buffer.IoBuffer;
|
||||
|
||||
import protocol.swg.SWGMessage;
|
||||
import engine.resources.common.CRC;
|
||||
import resources.common.Opcodes;
|
||||
|
||||
+2
-1
@@ -1,4 +1,4 @@
|
||||
package protocol.swg;
|
||||
package protocol.swg.chat;
|
||||
|
||||
import java.nio.ByteOrder;
|
||||
import java.util.List;
|
||||
@@ -7,6 +7,7 @@ import main.NGECore;
|
||||
|
||||
import org.apache.mina.core.buffer.IoBuffer;
|
||||
|
||||
import protocol.swg.SWGMessage;
|
||||
import resources.objects.player.PlayerObject;
|
||||
|
||||
// This is possibly unused
|
||||
+3
-1
@@ -19,12 +19,14 @@
|
||||
* Using NGEngine to work with NGECore2 is making a combined work based on NGEngine.
|
||||
* Therefore all terms and conditions of the GNU Lesser General Public License cover the combination.
|
||||
******************************************************************************/
|
||||
package protocol.swg;
|
||||
package protocol.swg.chat;
|
||||
|
||||
import java.nio.ByteOrder;
|
||||
|
||||
import org.apache.mina.core.buffer.IoBuffer;
|
||||
|
||||
import protocol.swg.SWGMessage;
|
||||
|
||||
public class ChatOnSendInstantMessage extends SWGMessage {
|
||||
|
||||
private int errorType;
|
||||
+3
-1
@@ -19,12 +19,14 @@
|
||||
* Using NGEngine to work with NGECore2 is making a combined work based on NGEngine.
|
||||
* Therefore all terms and conditions of the GNU Lesser General Public License cover the combination.
|
||||
******************************************************************************/
|
||||
package protocol.swg;
|
||||
package protocol.swg.chat;
|
||||
|
||||
import java.nio.ByteOrder;
|
||||
|
||||
import org.apache.mina.core.buffer.IoBuffer;
|
||||
|
||||
import protocol.swg.SWGMessage;
|
||||
|
||||
|
||||
public class ChatOnSendPersistentMessage extends SWGMessage {
|
||||
|
||||
+3
-1
@@ -19,12 +19,14 @@
|
||||
* Using NGEngine to work with NGECore2 is making a combined work based on NGEngine.
|
||||
* Therefore all terms and conditions of the GNU Lesser General Public License cover the combination.
|
||||
******************************************************************************/
|
||||
package protocol.swg;
|
||||
package protocol.swg.chat;
|
||||
|
||||
import java.nio.ByteOrder;
|
||||
|
||||
import org.apache.mina.core.buffer.IoBuffer;
|
||||
|
||||
import protocol.swg.SWGMessage;
|
||||
|
||||
public class ChatOnSendRoomMessage extends SWGMessage {
|
||||
|
||||
private int errorCode;
|
||||
+4
-1
@@ -19,11 +19,14 @@
|
||||
* Using NGEngine to work with NGECore2 is making a combined work based on NGEngine.
|
||||
* Therefore all terms and conditions of the GNU Lesser General Public License cover the combination.
|
||||
******************************************************************************/
|
||||
package protocol.swg;
|
||||
package protocol.swg.chat;
|
||||
|
||||
import java.nio.ByteOrder;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.mina.core.buffer.IoBuffer;
|
||||
|
||||
import protocol.swg.SWGMessage;
|
||||
import services.chat.WaypointAttachment;
|
||||
|
||||
|
||||
+4
-1
@@ -19,13 +19,16 @@
|
||||
* Using NGEngine to work with NGECore2 is making a combined work based on NGEngine.
|
||||
* Therefore all terms and conditions of the GNU Lesser General Public License cover the combination.
|
||||
******************************************************************************/
|
||||
package protocol.swg;
|
||||
package protocol.swg.chat;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.mina.core.buffer.IoBuffer;
|
||||
|
||||
import protocol.swg.SWGMessage;
|
||||
import services.chat.WaypointAttachment;
|
||||
|
||||
|
||||
@@ -0,0 +1,113 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2013 <Project SWG>
|
||||
*
|
||||
* This File is part of NGECore2.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Using NGEngine to work with NGECore2 is making a combined work based on NGEngine.
|
||||
* Therefore all terms and conditions of the GNU Lesser General Public License cover the combination.
|
||||
******************************************************************************/
|
||||
package protocol.swg.chat;
|
||||
|
||||
import java.nio.ByteOrder;
|
||||
import java.util.Vector;
|
||||
|
||||
import main.NGECore;
|
||||
|
||||
import org.apache.mina.core.buffer.IoBuffer;
|
||||
|
||||
import protocol.swg.SWGMessage;
|
||||
import resources.objects.creature.CreatureObject;
|
||||
import services.chat.ChatRoom;
|
||||
|
||||
public class ChatQueryRoomResults extends SWGMessage {
|
||||
|
||||
private ChatRoom room;
|
||||
private int requestId;
|
||||
|
||||
public ChatQueryRoomResults(ChatRoom room, int requestId) {
|
||||
this.room = room;
|
||||
this.requestId = requestId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deserialize(IoBuffer data) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public IoBuffer serialize() {
|
||||
String server = NGECore.getInstance().getGalaxyName();
|
||||
IoBuffer buffer = IoBuffer.allocate(100).order(ByteOrder.LITTLE_ENDIAN);
|
||||
|
||||
buffer.putShort((short) 7);
|
||||
buffer.putInt(0xC4DE864E);
|
||||
|
||||
Vector<CreatureObject> users = room.getUserList();
|
||||
|
||||
buffer.putInt(users.size());
|
||||
if (users.size() > 0) {
|
||||
for (CreatureObject creo : users) {
|
||||
buffer.put(getAsciiString("SWG"));
|
||||
buffer.put(getAsciiString(server));
|
||||
buffer.put(getAsciiString(creo.getCustomName()));
|
||||
}
|
||||
}
|
||||
|
||||
buffer.putInt(0); // TODO: Invited list for chat rooms
|
||||
|
||||
Vector<CreatureObject> moderators = room.getModeratorList();
|
||||
|
||||
buffer.putInt(moderators.size());
|
||||
if (moderators.size() > 0) {
|
||||
for (CreatureObject creo : users) {
|
||||
buffer.put(getAsciiString("SWG"));
|
||||
buffer.put(getAsciiString(server));
|
||||
buffer.put(getAsciiString(creo.getCustomName()));
|
||||
}
|
||||
}
|
||||
|
||||
Vector<CreatureObject> banned = room.getBanList();
|
||||
buffer.putInt(banned.size());
|
||||
if (banned.size() > 0) {
|
||||
for (CreatureObject creo : users) {
|
||||
buffer.put(getAsciiString("SWG"));
|
||||
buffer.put(getAsciiString(server));
|
||||
buffer.put(getAsciiString(creo.getCustomName()));
|
||||
}
|
||||
}
|
||||
|
||||
buffer.putInt(requestId);
|
||||
buffer.putInt(room.getRoomId());
|
||||
buffer.putInt(room.isPrivateRoom() ? 0 : 1);
|
||||
buffer.put((byte) (room.isModeratorsOnly() ? 1 : 0));
|
||||
|
||||
buffer.put(getAsciiString(room.getRoomAddress()));
|
||||
|
||||
buffer.put(getAsciiString("SWG"));
|
||||
buffer.put(getAsciiString(server));
|
||||
buffer.put(getAsciiString(room.getOwner()));
|
||||
|
||||
buffer.put(getAsciiString("SWG"));
|
||||
buffer.put(getAsciiString(server));
|
||||
buffer.put(getAsciiString(room.getCreator()));
|
||||
|
||||
buffer.put(getUnicodeString(room.getDescription()));
|
||||
|
||||
buffer.putInt(0); // moderator list
|
||||
buffer.putInt(0); // user list
|
||||
return buffer.flip();
|
||||
}
|
||||
|
||||
}
|
||||
+3
-1
@@ -19,10 +19,12 @@
|
||||
* Using NGEngine to work with NGECore2 is making a combined work based on NGEngine.
|
||||
* Therefore all terms and conditions of the GNU Lesser General Public License cover the combination.
|
||||
******************************************************************************/
|
||||
package protocol.swg;
|
||||
package protocol.swg.chat;
|
||||
|
||||
import org.apache.mina.core.buffer.IoBuffer;
|
||||
|
||||
import protocol.swg.SWGMessage;
|
||||
|
||||
|
||||
public class ChatRequestPersistentMessage extends SWGMessage {
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
* Using NGEngine to work with NGECore2 is making a combined work based on NGEngine.
|
||||
* Therefore all terms and conditions of the GNU Lesser General Public License cover the combination.
|
||||
******************************************************************************/
|
||||
package protocol.swg;
|
||||
package protocol.swg.chat;
|
||||
|
||||
import java.nio.ByteOrder;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
@@ -28,6 +28,8 @@ import main.NGECore;
|
||||
|
||||
import org.apache.mina.core.buffer.IoBuffer;
|
||||
|
||||
import protocol.swg.SWGMessage;
|
||||
import resources.common.StringUtilities;
|
||||
import services.chat.ChatRoom;
|
||||
|
||||
public class ChatRoomList extends SWGMessage {
|
||||
@@ -46,7 +48,7 @@ public class ChatRoomList extends SWGMessage {
|
||||
@Override
|
||||
public IoBuffer serialize() {
|
||||
String server = NGECore.getInstance().getGalaxyName();
|
||||
IoBuffer buffer = IoBuffer.allocate(100).order(ByteOrder.LITTLE_ENDIAN);
|
||||
IoBuffer buffer = IoBuffer.allocate(53).order(ByteOrder.LITTLE_ENDIAN);
|
||||
buffer.setAutoExpand(true);
|
||||
|
||||
buffer.putShort((short) 2);
|
||||
@@ -70,7 +72,9 @@ public class ChatRoomList extends SWGMessage {
|
||||
buffer.putInt(0); // user list (not used by client)
|
||||
}
|
||||
});
|
||||
return buffer.flip();
|
||||
buffer.flip();
|
||||
//StringUtilities.printBytes(buffer.array());
|
||||
return buffer;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -19,7 +19,7 @@
|
||||
* Using NGEngine to work with NGECore2 is making a combined work based on NGEngine.
|
||||
* Therefore all terms and conditions of the GNU Lesser General Public License cover the combination.
|
||||
******************************************************************************/
|
||||
package protocol.swg;
|
||||
package protocol.swg.chat;
|
||||
|
||||
import java.nio.ByteOrder;
|
||||
|
||||
@@ -27,6 +27,8 @@ import main.NGECore;
|
||||
|
||||
import org.apache.mina.core.buffer.IoBuffer;
|
||||
|
||||
import protocol.swg.SWGMessage;
|
||||
|
||||
public class ChatRoomMessage extends SWGMessage {
|
||||
|
||||
private String character;
|
||||
@@ -19,10 +19,12 @@
|
||||
* Using NGEngine to work with NGECore2 is making a combined work based on NGEngine.
|
||||
* Therefore all terms and conditions of the GNU Lesser General Public License cover the combination.
|
||||
******************************************************************************/
|
||||
package protocol.swg;
|
||||
package protocol.swg.chat;
|
||||
|
||||
import org.apache.mina.core.buffer.IoBuffer;
|
||||
|
||||
import protocol.swg.SWGMessage;
|
||||
|
||||
public class ChatSendToRoom extends SWGMessage {
|
||||
|
||||
private String message;
|
||||
@@ -0,0 +1,44 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2013 <Project SWG>
|
||||
*
|
||||
* This File is part of NGECore2.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Using NGEngine to work with NGECore2 is making a combined work based on NGEngine.
|
||||
* Therefore all terms and conditions of the GNU Lesser General Public License cover the combination.
|
||||
******************************************************************************/
|
||||
package protocol.swg.chat;
|
||||
|
||||
import java.nio.ByteOrder;
|
||||
|
||||
import org.apache.mina.core.buffer.IoBuffer;
|
||||
|
||||
import protocol.swg.SWGMessage;
|
||||
|
||||
public class ChatServerStatus extends SWGMessage {
|
||||
|
||||
@Override
|
||||
public void deserialize(IoBuffer data) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public IoBuffer serialize() {
|
||||
IoBuffer buffer = IoBuffer.allocate(7).order(ByteOrder.LITTLE_ENDIAN);
|
||||
buffer.putShort((short) 2);
|
||||
buffer.putInt(0x7102B15F);
|
||||
buffer.put((byte) 1);
|
||||
return buffer.flip();
|
||||
}
|
||||
}
|
||||
+2
-1
@@ -19,12 +19,13 @@
|
||||
* Using NGEngine to work with NGECore2 is making a combined work based on NGEngine.
|
||||
* Therefore all terms and conditions of the GNU Lesser General Public License cover the combination.
|
||||
******************************************************************************/
|
||||
package protocol.swg;
|
||||
package protocol.swg.chat;
|
||||
|
||||
import java.nio.ByteOrder;
|
||||
|
||||
import org.apache.mina.core.buffer.IoBuffer;
|
||||
|
||||
import protocol.swg.SWGMessage;
|
||||
import resources.common.Opcodes;
|
||||
|
||||
public class ChatSystemMessage extends SWGMessage{
|
||||
@@ -34,12 +34,12 @@ import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.apache.mina.core.buffer.IoBuffer;
|
||||
|
||||
import protocol.swg.ChatSystemMessage;
|
||||
import protocol.swg.ObjControllerMessage;
|
||||
import protocol.swg.PlayClientEffectObjectMessage;
|
||||
import protocol.swg.PlayMusicMessage;
|
||||
import protocol.swg.UpdatePostureMessage;
|
||||
import protocol.swg.UpdatePVPStatusMessage;
|
||||
import protocol.swg.chat.ChatSystemMessage;
|
||||
import protocol.swg.objectControllerObjects.Animation;
|
||||
import protocol.swg.objectControllerObjects.Posture;
|
||||
|
||||
|
||||
@@ -60,15 +60,15 @@ import engine.resources.scene.Quaternion;
|
||||
import engine.resources.scene.quadtree.QuadTree;
|
||||
import engine.resources.service.INetworkDispatch;
|
||||
import engine.resources.service.INetworkRemoteEvent;
|
||||
import protocol.swg.ChatFriendsListUpdate;
|
||||
import protocol.swg.ChatOnChangeFriendStatus;
|
||||
import protocol.swg.ChatOnGetFriendsList;
|
||||
import protocol.swg.CmdStartScene;
|
||||
import protocol.swg.HeartBeatMessage;
|
||||
import protocol.swg.ObjControllerMessage;
|
||||
import protocol.swg.OpenedContainerMessage;
|
||||
import protocol.swg.UpdateTransformMessage;
|
||||
import protocol.swg.UpdateTransformWithParentMessage;
|
||||
import protocol.swg.chat.ChatFriendsListUpdate;
|
||||
import protocol.swg.chat.ChatOnChangeFriendStatus;
|
||||
import protocol.swg.chat.ChatOnGetFriendsList;
|
||||
import protocol.swg.objectControllerObjects.DataTransform;
|
||||
import protocol.swg.objectControllerObjects.DataTransformWithParent;
|
||||
import protocol.swg.objectControllerObjects.TargetUpdate;
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
******************************************************************************/
|
||||
package services.chat;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Vector;
|
||||
|
||||
import resources.objects.creature.CreatureObject;
|
||||
@@ -29,8 +28,6 @@ import resources.objects.creature.CreatureObject;
|
||||
import com.sleepycat.persist.model.Entity;
|
||||
import com.sleepycat.persist.model.NotPersistent;
|
||||
import com.sleepycat.persist.model.PrimaryKey;
|
||||
import com.sleepycat.persist.model.Relationship;
|
||||
import com.sleepycat.persist.model.SecondaryKey;
|
||||
|
||||
@Entity
|
||||
public class ChatRoom {
|
||||
@@ -45,8 +42,6 @@ public class ChatRoom {
|
||||
@NotPersistent
|
||||
private Vector<CreatureObject> userList = new Vector<CreatureObject>(); // current users
|
||||
|
||||
@NotPersistent
|
||||
private int requestId; // not-persistent
|
||||
private boolean moderatorsOnly;
|
||||
private boolean privateRoom;
|
||||
private boolean visible;
|
||||
@@ -92,14 +87,6 @@ public class ChatRoom {
|
||||
this.userList = userList;
|
||||
}
|
||||
|
||||
public int getRequestId() {
|
||||
return requestId;
|
||||
}
|
||||
|
||||
public void setRequestId(int requestId) {
|
||||
this.requestId = requestId;
|
||||
}
|
||||
|
||||
public boolean isModeratorsOnly() {
|
||||
return moderatorsOnly;
|
||||
}
|
||||
|
||||
@@ -49,27 +49,28 @@ import resources.common.*;
|
||||
import resources.objects.creature.CreatureObject;
|
||||
import resources.objects.player.PlayerObject;
|
||||
import protocol.swg.AddIgnoreMessage;
|
||||
import protocol.swg.ChatCreateRoom;
|
||||
import protocol.swg.ChatEnterRoomById;
|
||||
import protocol.swg.ChatOnChangeFriendStatus;
|
||||
import protocol.swg.ChatDeletePersistentMessage;
|
||||
import protocol.swg.ChatFriendsListUpdate;
|
||||
import protocol.swg.ChatInstantMessageToCharacter;
|
||||
import protocol.swg.ChatInstantMessagetoClient;
|
||||
import protocol.swg.ChatOnAddFriend;
|
||||
import protocol.swg.ChatOnCreateRoom;
|
||||
import protocol.swg.ChatOnEnteredRoom;
|
||||
import protocol.swg.ChatOnSendInstantMessage;
|
||||
import protocol.swg.ChatOnSendPersistentMessage;
|
||||
import protocol.swg.ChatOnSendRoomMessage;
|
||||
import protocol.swg.ChatPersistentMessageToClient;
|
||||
import protocol.swg.ChatPersistentMessageToServer;
|
||||
import protocol.swg.ChatRequestPersistentMessage;
|
||||
import protocol.swg.ChatRoomList;
|
||||
import protocol.swg.ChatRoomMessage;
|
||||
import protocol.swg.ChatSendToRoom;
|
||||
import protocol.swg.ChatSystemMessage;
|
||||
import protocol.swg.ObjControllerMessage;
|
||||
import protocol.swg.chat.ChatCreateRoom;
|
||||
import protocol.swg.chat.ChatDeletePersistentMessage;
|
||||
import protocol.swg.chat.ChatEnterRoomById;
|
||||
import protocol.swg.chat.ChatFriendsListUpdate;
|
||||
import protocol.swg.chat.ChatInstantMessageToCharacter;
|
||||
import protocol.swg.chat.ChatInstantMessagetoClient;
|
||||
import protocol.swg.chat.ChatOnAddFriend;
|
||||
import protocol.swg.chat.ChatOnChangeFriendStatus;
|
||||
import protocol.swg.chat.ChatOnCreateRoom;
|
||||
import protocol.swg.chat.ChatOnEnteredRoom;
|
||||
import protocol.swg.chat.ChatOnSendInstantMessage;
|
||||
import protocol.swg.chat.ChatOnSendPersistentMessage;
|
||||
import protocol.swg.chat.ChatOnSendRoomMessage;
|
||||
import protocol.swg.chat.ChatPersistentMessageToClient;
|
||||
import protocol.swg.chat.ChatPersistentMessageToServer;
|
||||
import protocol.swg.chat.ChatRequestPersistentMessage;
|
||||
import protocol.swg.chat.ChatRoomList;
|
||||
import protocol.swg.chat.ChatRoomMessage;
|
||||
import protocol.swg.chat.ChatSendToRoom;
|
||||
import protocol.swg.chat.ChatServerStatus;
|
||||
import protocol.swg.chat.ChatSystemMessage;
|
||||
import protocol.swg.objectControllerObjects.PlayerEmote;
|
||||
import protocol.swg.objectControllerObjects.SpatialChat;
|
||||
import main.NGECore;
|
||||
@@ -363,15 +364,17 @@ public class ChatService implements INetworkDispatch {
|
||||
if (obj == null)
|
||||
return;
|
||||
|
||||
ChatRoomList listMessage = new ChatRoomList(chatRooms);
|
||||
//ChatServerStatus chatServerStatus = new ChatServerStatus();
|
||||
//client.getSession().write(chatServerStatus.serialize());
|
||||
|
||||
ChatRoomList listMessage = new ChatRoomList(chatRooms);
|
||||
client.getSession().write(listMessage.serialize());
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
swgOpcodes.put(Opcodes.ChatCreateRoom, (session, data) -> {
|
||||
data.order(ByteOrder.LITTLE_ENDIAN);
|
||||
/*data.order(ByteOrder.LITTLE_ENDIAN);
|
||||
|
||||
Client client = core.getClient(session);
|
||||
|
||||
@@ -389,19 +392,33 @@ public class ChatService implements INetworkDispatch {
|
||||
sentPacket.deserialize(data);
|
||||
|
||||
ChatRoom room = createChatRoom(sentPacket.getTitle(), sentPacket.getAddress(), creo.getCustomName().toLowerCase(), true, false);
|
||||
room.setPrivateRoom(sentPacket.isPrivacy());
|
||||
room.setModeratorsOnly(sentPacket.isModeratorOnly());
|
||||
|
||||
if (room != null) {
|
||||
room.setPrivateRoom(sentPacket.isPrivacy());
|
||||
room.setModeratorsOnly(sentPacket.isModeratorOnly());
|
||||
room.getUserList().add(creo);
|
||||
room.getModeratorList().add(creo);
|
||||
ChatOnCreateRoom response = new ChatOnCreateRoom(room, 0, sentPacket.getRequest());
|
||||
session.write(response.serialize());
|
||||
}
|
||||
}*/
|
||||
|
||||
});
|
||||
|
||||
swgOpcodes.put(Opcodes.ChatQueryRoom, (session, data) -> {
|
||||
data.order(ByteOrder.LITTLE_ENDIAN);
|
||||
//StringUtilities.printBytes(data.array());
|
||||
Client client = core.getClient(session);
|
||||
|
||||
if(client == null)
|
||||
return;
|
||||
|
||||
SWGObject obj = client.getParent();
|
||||
|
||||
if (obj == null)
|
||||
return;
|
||||
|
||||
|
||||
|
||||
});
|
||||
|
||||
swgOpcodes.put(Opcodes.ChatSendToRoom, (session, data) -> {
|
||||
@@ -441,7 +458,7 @@ public class ChatService implements INetworkDispatch {
|
||||
|
||||
joinChatRoom((CreatureObject) obj, sentPacket.getRoomId());
|
||||
|
||||
System.out.println("Entering room... " + sentPacket.getRoomId());
|
||||
//System.out.println("Entering room... " + sentPacket.getRoomId());
|
||||
|
||||
});
|
||||
}
|
||||
@@ -728,15 +745,15 @@ public class ChatService implements INetworkDispatch {
|
||||
|
||||
if (creator.contains(" "))
|
||||
creator = creator.split(" ")[0];
|
||||
|
||||
|
||||
ChatRoom room = new ChatRoom();
|
||||
room.setDescription(roomName);
|
||||
if (!address.startsWith("SWG."))
|
||||
room.setRoomAddress("SWG." + core.getGalaxyName() + "." + address);
|
||||
else
|
||||
room.setRoomAddress(address);
|
||||
room.setCreator(creator);
|
||||
room.setOwner(creator);
|
||||
room.setCreator(creator.toLowerCase());
|
||||
room.setOwner(creator.toLowerCase());
|
||||
room.setVisible(showInList);
|
||||
room.setRoomId(generateChatRoomId());
|
||||
|
||||
|
||||
@@ -58,10 +58,6 @@ import com.sleepycat.persist.EntityCursor;
|
||||
import com.sleepycat.persist.model.Entity;
|
||||
import com.sleepycat.persist.model.PrimaryKey;
|
||||
|
||||
import protocol.swg.ChatFriendsListUpdate;
|
||||
import protocol.swg.ChatOnChangeFriendStatus;
|
||||
import protocol.swg.ChatOnGetFriendsList;
|
||||
import protocol.swg.ChatRoomList;
|
||||
import protocol.swg.CmdSceneReady;
|
||||
import protocol.swg.CmdStartScene;
|
||||
import protocol.swg.HeartBeatMessage;
|
||||
@@ -70,6 +66,12 @@ import protocol.swg.ParametersMessage;
|
||||
import protocol.swg.SelectCharacter;
|
||||
import protocol.swg.ServerTimeMessage;
|
||||
import protocol.swg.UnkByteFlag;
|
||||
import protocol.swg.chat.ChatFriendsListUpdate;
|
||||
import protocol.swg.chat.ChatOnChangeFriendStatus;
|
||||
import protocol.swg.chat.ChatOnConnectAvatar;
|
||||
import protocol.swg.chat.ChatOnGetFriendsList;
|
||||
import protocol.swg.chat.ChatRoomList;
|
||||
import protocol.swg.chat.ChatServerStatus;
|
||||
import protocol.swg.objectControllerObjects.UiPlayEffect;
|
||||
import engine.clientdata.ClientFileManager;
|
||||
import engine.clientdata.visitors.CrcStringTableVisitor;
|
||||
@@ -783,10 +785,18 @@ public class ObjectService implements INetworkDispatch {
|
||||
core.chatService.loadMailHeaders(client);
|
||||
|
||||
core.simulationService.handleZoneIn(client);
|
||||
|
||||
creature.makeAware(creature);
|
||||
|
||||
ChatServerStatus chatStatus = new ChatServerStatus();
|
||||
creature.getClient().getSession().write(chatStatus.serialize());
|
||||
|
||||
ChatOnConnectAvatar chatConnect = new ChatOnConnectAvatar();
|
||||
creature.getClient().getSession().write(chatConnect.serialize());
|
||||
|
||||
ChatRoomList chatRooms = new ChatRoomList(core.chatService.getChatRooms());
|
||||
creature.getClient().getSession().write(chatRooms.serialize());
|
||||
|
||||
//ChatOnGetFriendsList friendsListMessage = new ChatOnGetFriendsList(ghost);
|
||||
//client.getSession().write(friendsListMessage.serialize());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user