Package voxo.server.actions

Source Code of voxo.server.actions.SendMessageAction

package voxo.server.actions;

import java.io.IOException;
import java.net.UnknownHostException;

import voxo.common.entities.Packet;
import voxo.common.entities.User;
import voxo.common.enums.EnumPacket;
import voxo.server.services.NetworkService;

public class SendMessageAction {
  public SendMessageAction(String m, User u, EnumPacket ep) throws UnknownHostException, IOException {
    if (u.getOnline() && (u.getIp() != null)) {
      if ((ep != EnumPacket.SERVER_Notice) && (ep != EnumPacket.SERVER_Error)) {
        return;
      }
      NetworkService.sendPacket(u.getIp(), new Packet(ep, m));
    }
  }
}
TOP

Related Classes of voxo.server.actions.SendMessageAction

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.