mirror of
https://github.com/ProjectSWGCore/NGECore2.git
synced 2026-10-06 21:12:59 -04:00
Added SWG, Server, and other parent channels
This commit is contained in:
@@ -809,7 +809,9 @@ public class SimulationService implements INetworkDispatch {
|
||||
PlayerObject ghost = (PlayerObject) object.getSlottedObject("ghost");
|
||||
|
||||
core.weatherService.sendWeather(object);
|
||||
|
||||
|
||||
//core.chatService.joinChatRoom(object.getCustomName().toLowerCase(), "SWG." + core.getGalaxyName() + "." + object.getPlanet().getName());
|
||||
|
||||
if (!object.hasSkill(ghost.getProfessionWheelPosition())) {
|
||||
object.showFlyText("cbt_spam", "skill_up", (float) 2.5, new RGB(154, 205, 50), 0);
|
||||
object.playEffectObject("clienteffect/skill_granted.cef", "");
|
||||
|
||||
@@ -176,6 +176,7 @@ public class TerrainService {
|
||||
noBuildAreas.put(planet, new ArrayList<CollidableCircle>());
|
||||
loadClientRegions(planet);
|
||||
|
||||
core.chatService.createChatRoom("", name, "system", true);
|
||||
core.chatService.createChatRoom("public chat for this planet, cannot create rooms here", name + ".Planet", "SYSTEM", true);
|
||||
core.chatService.createChatRoom("system messages for this planet, cannot create rooms here", name + ".system", "SYSTEM", true);
|
||||
|
||||
|
||||
@@ -738,8 +738,11 @@ public class ChatService implements INetworkDispatch {
|
||||
* TODO: Research other channel address formats
|
||||
*/
|
||||
|
||||
ChatRoom system = createChatRoom("", "system", "system", true);
|
||||
System.out.println("Created chat room " + system.getRoomAddress());
|
||||
createChatRoom("", "SWG", "system", true);
|
||||
createChatRoom("", "SWG." + core.getGalaxyName(), "system", true);
|
||||
|
||||
createChatRoom("", "system", "system", true); // galaxy system messages
|
||||
createChatRoom("", "Auction", "system", true);
|
||||
|
||||
//createChatRoom("Bounty Hunter chat for this galaxy", "BountyHunter", "SYSTEM", true);
|
||||
//createChatRoom("Commando chat for this galaxy", "Commando", "SYSTEM", true);
|
||||
@@ -751,23 +754,23 @@ public class ChatService implements INetworkDispatch {
|
||||
cursor.close();
|
||||
}
|
||||
|
||||
public ChatRoom createChatRoom(String roomName, String address, String creator, boolean showInList) {
|
||||
return createChatRoom(roomName, address, creator, showInList, false);
|
||||
public ChatRoom createChatRoom(String roomName, String address, String creator, boolean isPublic) {
|
||||
return createChatRoom(roomName, address, creator, isPublic, false);
|
||||
}
|
||||
public ChatRoom createChatRoom(String roomName, String address, String creator, boolean showInList, boolean store) {
|
||||
public ChatRoom createChatRoom(String roomName, String address, String creator, boolean isPublic, boolean store) {
|
||||
|
||||
if (creator.contains(" "))
|
||||
creator = creator.split(" ")[0];
|
||||
|
||||
ChatRoom room = new ChatRoom();
|
||||
room.setDescription(roomName);
|
||||
if (!address.startsWith("SWG."))
|
||||
if (!address.startsWith("SWG"))
|
||||
room.setRoomAddress("SWG." + core.getGalaxyName() + "." + address);
|
||||
else
|
||||
room.setRoomAddress(address);
|
||||
room.setCreator(creator.toLowerCase());
|
||||
room.setOwner(creator.toLowerCase());
|
||||
room.setVisible(showInList);
|
||||
room.setVisible(isPublic);
|
||||
room.setRoomId(generateChatRoomId());
|
||||
|
||||
chatRooms.put(room.getRoomId(), room);
|
||||
@@ -784,13 +787,13 @@ public class ChatService implements INetworkDispatch {
|
||||
public boolean joinChatRoom(String user, String roomAddress) {
|
||||
chatRooms.forEach((k, v) -> {
|
||||
if (v.getRoomAddress().equals(roomAddress)) {
|
||||
joinChatRoom(user, k);
|
||||
joinChatRoom(user, k, true);
|
||||
return;
|
||||
}
|
||||
});
|
||||
return false;
|
||||
}
|
||||
public boolean joinChatRoom(String user, int roomId) {
|
||||
public boolean joinChatRoom(String user, int roomId, boolean resendList) {
|
||||
|
||||
if (user.contains(" "))
|
||||
user = user.split(" ")[0];
|
||||
@@ -802,7 +805,7 @@ public class ChatService implements INetworkDispatch {
|
||||
if (!room.hasUser(user.toLowerCase())) {
|
||||
room.addUser(user.toLowerCase());
|
||||
|
||||
if (!room.isVisible()) {
|
||||
if (!room.isVisible() || resendList) {
|
||||
CreatureObject creo = (CreatureObject) getObjectByFirstName(user);
|
||||
if (creo != null) {
|
||||
ChatRoomList listMessage = new ChatRoomList(room);
|
||||
@@ -810,16 +813,16 @@ public class ChatService implements INetworkDispatch {
|
||||
}
|
||||
}
|
||||
ChatOnEnteredRoom enterRoom = new ChatOnEnteredRoom(user, 0, roomId, true);
|
||||
|
||||
room.getUserList().stream().forEach(str -> {
|
||||
SWGObject userObj = getObjectByFirstName(str);
|
||||
userObj.getClient().getSession().write(enterRoom.serialize());
|
||||
});
|
||||
getObjectByFirstName(user).getClient().getSession().write(enterRoom.serialize());
|
||||
//System.out.println("Sent message for room " + room.getRoomAddress());
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean joinChatRoom(String user, int roomId) {
|
||||
return joinChatRoom(user, roomId, false);
|
||||
}
|
||||
public void leaveChatRoom(CreatureObject player, int roomId) {
|
||||
|
||||
String playerName = player.getCustomName().toLowerCase();
|
||||
|
||||
@@ -833,7 +833,6 @@ public class ObjectService implements INetworkDispatch {
|
||||
if(!core.getConfig().getString("MOTD").equals(""))
|
||||
creature.sendSystemMessage(core.getConfig().getString("MOTD"), (byte) 2);
|
||||
|
||||
core.chatService.joinChatRoom(creature.getCustomName().toLowerCase(), "SWG." + core.getGalaxyName() + "." + creature.getPlanet().getName() + ".Planet");
|
||||
core.playerService.postZoneIn(creature);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user