• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook page for updates, we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.) When you see an Incapsula error, you know we are in the process of migration.

Monster Carnival

Legendary Battlemage
Joined
Mar 7, 2013
Messages
686
Reaction score
43
Hello i have a problem , when enter in CPQ Lobby, show this message "MP will start, but over 10 seconds and nothing happened, and no errors in server console...
you can helpme?


pic:



mixtamal6 - Monster Carnival - RaGEZONE Forums


Solved Thanks to ERICK and Yuuroido n.n
 
Last edited:
Legendary Battlemage
Joined
Mar 7, 2013
Messages
686
Reaction score
43
Script? Code snippet?
Is internal code, im use method call startcpq in npcconversationmanager


Code:
 public void startCPQ(final MapleCharacter challenger, int field) {
		try {
			if (challenger != null) {
	if (challenger.getParty() == null) throw new RuntimeException("Challenger's party was null!");
				for (MaplePartyCharacter mpc : challenger.getParty().getMembers()) {
					MapleCharacter mc;
					mc = c.getChannelServer().getPlayerStorage().getCharacterByName(mpc.getName());
					if (mc != null) {
                mc.changeMap(c.getPlayer().getMap(), c.getPlayer().getMap().getPortal(0));
						mc.getClient().getSession().write(MaplePacketCreator.getClock(10));
                   
					}
				}
			}
                        
                        final int mapid = c.getPlayer().getMap().getId() + 1;
			TimerManager.getInstance().schedule(new Runnable() {
				@Override public void run() {
					new MonsterCarnival(getPlayer().getParty(), challenger.getParty(), mapid);
}
			}, 1000);
			mapMessage(5, "Monster Carnival will start!"); //only show this message 
		} catch (Exception ex) {
			ex.printStackTrace();
		}
	}
 
Last edited:
Upvote 0
Mythic Archon
Joined
Jul 2, 2013
Messages
723
Reaction score
70
If this is an event, make sure the instance has been added to the proper location; meaning, if your server has a sep folder where specific event scripts are loaded during start up-make sure it's there; or, like most public sources, gameconstance (or server?) has a thing for specific event scripts to be loaded during launch.
 
Upvote 0
Legendary Battlemage
Joined
Mar 7, 2013
Messages
686
Reaction score
43
thanks for reply, i dont found the problem :S

is my MonsterCarnival.java


PHP:
public MonsterCarnival(MapleParty p1, MapleParty p2, int mapid) {            System.out.println("INICIA MONSTERCARNIVAL.JAVA ? ");        this.p1 = p1;        this.p2 = p2;        int chnl = p1.getLeader().getChannel();        int chnl1 = p2.getLeader().getChannel();        if (chnl != chnl1) throw new RuntimeException("CPQ leaders are on different channels..");        ChannelServer cs = ChannelServer.getInstance(chnl);        p1.setEnemy(p2);        p2.setEnemy(p1);        cs.getMapFactory().disposeMap(mapid);        map = cs.getMapFactory().getMap(mapid);        int redPortal = 0;        int bluePortal = 0;        if (map.isPurpleCPQMap()) {            redPortal = 2;            bluePortal = 1;        }        for (MaplePartyCharacter mpc : p1.getMembers()) {            MapleCharacter mc;            mc = cs.getPlayerStorage().getCharacterByName(mpc.getName());            if (mc != null) {                mc.setMonsterCarnival(this);                mc.changeMap(map, map.getPortal(redPortal));                mc.setTeam(0);                if (p1.getLeader().getId() == mc.getId()) {                    leader1 = mc;                }                                Grupo1 = mc;            }        }        for (MaplePartyCharacter mpc : p2.getMembers()) {            MapleCharacter mc;            mc = cs.getPlayerStorage().getCharacterByName(mpc.getName());            if (mc != null) {                mc.setMonsterCarnival(this);                mc.changeMap(map, map.getPortal(bluePortal));                mc.setTeam(1);                if (p2.getLeader().getId() == mc.getId()) {                    leader2 = mc;                }                                Grupo2 = mc;            }        }
 
Last edited:
Upvote 0
Mythic Archon
Joined
Jul 2, 2013
Messages
723
Reaction score
70
thanks for reply, i found the problem :S

is in MonsterCarnival.java in this part:


I guess as my server is multiworld, because in the npc scripts zone,
use npc / "+ getworld () +" ".js"


I guess the instance does not recognize the channel and so it does not start the event, but I do not know how to change it, I tried but I did not get a solution


PHP:
public MonsterCarnival(MapleParty p1, MapleParty p2, int mapid) {            System.out.println("INICIA MONSTERCARNIVAL.JAVA ? ");        this.p1 = p1;        this.p2 = p2;        int chnl = p1.getLeader().getChannel();        int chnl1 = p2.getLeader().getChannel();        if (chnl != chnl1) throw new RuntimeException("CPQ leaders are on different channels..");        ChannelServer cs = ChannelServer.getInstance(chnl);        p1.setEnemy(p2);        p2.setEnemy(p1);        cs.getMapFactory().disposeMap(mapid);        map = cs.getMapFactory().getMap(mapid);        int redPortal = 0;        int bluePortal = 0;        if (map.isPurpleCPQMap()) {            redPortal = 2;            bluePortal = 1;        }        for (MaplePartyCharacter mpc : p1.getMembers()) {            MapleCharacter mc;            mc = cs.getPlayerStorage().getCharacterByName(mpc.getName());            if (mc != null) {                mc.setMonsterCarnival(this);                mc.changeMap(map, map.getPortal(redPortal));                mc.setTeam(0);                if (p1.getLeader().getId() == mc.getId()) {                    leader1 = mc;                }                                Grupo1 = mc;            }        }        for (MaplePartyCharacter mpc : p2.getMembers()) {            MapleCharacter mc;            mc = cs.getPlayerStorage().getCharacterByName(mpc.getName());            if (mc != null) {                mc.setMonsterCarnival(this);                mc.changeMap(map, map.getPortal(bluePortal));                mc.setTeam(1);                if (p2.getLeader().getId() == mc.getId()) {                    leader2 = mc;                }                                Grupo2 = mc;            }        }
I guess as my server is multiworld, because in the npc scripts zone, use npc / "+ getworld () +" ".js"I guess the instance does not recognize the channel and so it does not start the event, but I do not know how to change it, I tried but I did not get a solution

If your server is multiworld, then it should have a separate folder for the scripts; in the case, move the script into that folder so it is properly loaded during the startup. As for the channel thing, its not actually not allowing you in because of different channels-its checking to see if all players are in the same channel and map as the party leader.
 
Upvote 0
Legendary Battlemage
Joined
Mar 7, 2013
Messages
686
Reaction score
43
How to convert this :


Code:
int chnl = p1.getLeader().getChannel();
         int chnl1 = p2.getLeader().getChannel();
        if (chnl != chnl1) throw new RuntimeException("[CPQ Leaders need in same channel.");
        [SIZE=4][B]ChannelServer cs = ChannelServer.getInstance(chnl );[/B][/SIZE]

i use solaxia ,base moopleDev?
 
Upvote 0
Custom Title Activated
Loyal Member
Joined
Jan 18, 2010
Messages
3,109
Reaction score
1,139
How to convert this :


Code:
int chnl = p1.getLeader().getChannel();
         int chnl1 = p2.getLeader().getChannel();
        if (chnl != chnl1) throw new RuntimeException("[CPQ Leaders need in same channel.");
        [SIZE=4][B]ChannelServer cs = ChannelServer.getInstance(chnl );[/B][/SIZE]

i use solaxia ,base moopleDev?

Just look at the parameters.. In Moople, a ChannelServer instance is returned from getInstance(world, channel). So.. either do getInstance(0, chnl) for a single-world, or use getInstance(p1.getLeader().getWorld(), chnl) and support multi-worlds.
 
Upvote 0
Legendary Battlemage
Joined
Mar 7, 2013
Messages
686
Reaction score
43
If change parameters, could start monster carnival, over 10 seconds? :s

 
Upvote 0
Legendary Battlemage
Joined
Mar 7, 2013
Messages
686
Reaction score
43
@Erick Thanks for reply, i have this get instance, return only int channel :S

always the same problem, when leader party 1 , accept the challenge from leader party 2, change a map cpolobby, but finish time 10 seconds, nothing happen :d , any errors in serverconsole :s


CPQ:
Code:
public MonsterCarnival(MapleParty p1, MapleParty p2, int mapid) {
        this.p1 = p1;
        this.p2 = p2;
        [B]int chnl = p1.getLeader().getChannel();[/B]
        int chnl1 = p2.getLeader().getChannel();
        if (chnl != chnl1) throw new RuntimeException("[Leaders need in the same channels.");
        [B]ChannelServer cs = ChannelServer.getInstance(chnl);[/B]
        p1.setEnemy(p2);
        p2.setEnemy(p1);
            cs.getMapFactory().disposeMap(mapid);
        map = cs.getMapFactory().getMap(mapid);
        int redPortal = 0;
        int bluePortal = 0;
        if (map.isPurpleCPQMap()) {
            redPortal = 2;
            bluePortal = 1;
        }
                
                if (cs.getMapFactory().getMap(mapid - 1).getCharacters().size() != p1.getMembers().size() + p2.getMembers().size()) return;
                
        for (MaplePartyCharacter mpc : p1.getMembers()) {
            MapleCharacter mc = cs.getPlayerStorage().getCharacterByName(mpc.getName());
            if (mc != null) {   
                        if (mc.getMapId() == mapid - 1) {        
                mc.setMonsterCarnival(this);
                mc.changeMap(map, map.getPortal(redPortal));
                mc.setTeam(0);
                                mc.setFestivalPoints(0);
                                mc.dropMessage(6, "Press Keys f1 ~ f12 to active tramps");
                                
                if (p1.getLeader().getId() == mc.getId()) {
                    leader1 = mc;
                }
              } else {
                        mc.dropMessage(6, "Cant Start Carnival");




CHANNELSERVER.java
Code:
public ChannelServer(final int world, final int channel) {
        this.world = world;
        this.channel = channel;
        this.mapFactory = new MapleMapFactory(MapleDataProviderFactory.getDataProvider(new File(System.getProperty("wzpath") + "/Map.wz")), MapleDataProviderFactory.getDataProvider(new File(System.getProperty("wzpath") + "/String.wz")), world, channel);
        try {
            eventSM = new EventScriptManager(this, getEvents());
            port = 7575 + this.channel - 1;
            port += (world * 100);
            ip = ServerConstants.HOST + ":" + port;
            IoBuffer.setUseDirectBuffer(false);
            IoBuffer.setAllocator(new SimpleBufferAllocator());
            acceptor = new NioSocketAcceptor();
            TimerManager.getInstance().register(new respawnMaps(), 10000);
            acceptor.setHandler(new MapleServerHandler(world, channel));
            acceptor.getSessionConfig().setIdleTime(IdleStatus.BOTH_IDLE, 30);
            acceptor.getFilterChain().addLast("codec", (IoFilter) new ProtocolCodecFilter(new MapleCodecFactory()));
            acceptor.bind(new InetSocketAddress(port));
            ((SocketSessionConfig) acceptor.getSessionConfig()).setTcpNoDelay(true);
            for (MapleExpeditionType exped : MapleExpeditionType.values()) {
                expedType.add(exped);
            }
            eventSM.init();
            
            System.out.println("    Channel " + getId() + ": Listening on port " + port);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

[SIZE=4][B]public static ChannelServer getInstance(int channel) {[/B][/SIZE]
[SIZE=4][B]        return instances.get(channel);[/B][/SIZE]
[SIZE=4][B]    }[/B][/SIZE]

:/
 
Last edited:
Upvote 0
Legendary Battlemage
Joined
Mar 7, 2013
Messages
686
Reaction score
43
Here:

Code:
public int getChannel() {
		return channel;
	}


	public ChannelServer getChannelServer() {
		return Server.getInstance().getChannel(world, channel);
	}


	public World getWorldServer() {
		return Server.getInstance().getWorld(world);
	}


	public ChannelServer getChannelServer(byte channel) {
		return Server.getInstance().getChannel(world, channel);
	}
 
Upvote 0
Skilled Illusionist
Joined
Jul 17, 2010
Messages
333
Reaction score
165
Then this
Code:
ChannelServer cs = ChannelServer.getInstance(chnl);
should be
Code:
ChannelServer cs = Server.getInstance().getChannel(p1.getLeader().getWorld(), chnl);//or like that
(as Eric mentioned above)
 
Last edited:
Upvote 0
Legendary Battlemage
Joined
Mar 7, 2013
Messages
686
Reaction score
43
OMG! Thanks So much Yuuroido and Erick!!! n_n/ Thanks Bro.
 
Last edited:
Upvote 0
Skilled Illusionist
Joined
Jul 17, 2010
Messages
333
Reaction score
165
Oh, no. That's what Eric already pointed out. Please find out why it didn't work properly (...maybe for your future reference?).
Tbh, I wonder why your ChannelServer has 'instances' although it won't be added any channels...
 
Upvote 0
Legendary Battlemage
Joined
Mar 7, 2013
Messages
686
Reaction score
43
@Yuuroido

Because the first leader sees the challenger party of the same red team, but the party challenger sees it as a blue team, and also never add carnival points when defeating enemies.
i use maplesolaxia v83, in dynastory work good carnival :l use the same packets and opcodes.
StartCPQ:






Code:
public MonsterCarnival(MapleParty p1, MapleParty p2, int mapid) {
                this.p1 = p1;
		this.p2 = p2;
		int chnl = p1.getLeader().getChannel();
		int chnl1 = p2.getLeader().getChannel();
		if (chnl != chnl1) throw new RuntimeException("CPQ leaders are on different channels..");
                ChannelServer cs = Server.getInstance().getChannel(p1.getLeader().getWorld(), chnl);
		p1.setEnemy(p2);
		p2.setEnemy(p1);
		cs.getMapFactory().disposeMap(mapid);
		map = cs.getMapFactory().getMap(mapid);
		int redPortal = 0;
		int bluePortal = 0;
		if (map.isPurpleCPQMap()) {
			redPortal = 2;
			bluePortal = 1;
		}
		for (MaplePartyCharacter mpc : p1.getMembers()) {
			MapleCharacter mc;
			mc = cs.getPlayerStorage().getCharacterByName(mpc.getName());
			if (mc != null) {
				mc.setMonsterCarnival(this);
				mc.changeMap(map, map.getPortal(redPortal));
				mc.setTeam(0);
				if (p1.getLeader().getId() == mc.getId()) {
					leader1 = mc;
				}
                                Grupo1 = mc;
			}
		}
		for (MaplePartyCharacter mpc : p2.getMembers()) {
			MapleCharacter mc;
			mc = cs.getPlayerStorage().getCharacterByName(mpc.getName());
			if (mc != null) {
				mc.setMonsterCarnival(this);
				mc.changeMap(map, map.getPortal(bluePortal));
				mc.setTeam(1);
				if (p2.getLeader().getId() == mc.getId()) {
					leader2 = mc;
				}
                                Grupo2 = mc;
			}
		}
               Grupo1.getClient().getSession().write(MaplePacketCreator.startCPQ(Grupo1.getTeam(), Grupo1, Grupo2));
		Grupo2.getClient().getSession().write(MaplePacketCreator.startCPQ(Grupo2.getTeam(), Grupo2, Grupo1));
		
                startTime = System.currentTimeMillis() + 60 * 10000;
		timer = TimerManager.getInstance().schedule(new Runnable() {
			public void run() {
				timeUp();
			}
		}, 10 * 60 * 1000);
		effectTimer = TimerManager.getInstance().schedule(new Runnable() {
			public void run() {
				complete();
			}
		}, 10 * 60 * 1000 - 10 * 1000);
		TimerManager.getInstance().schedule(new Runnable() {
			public void run() {
				map.addClock(60 * 10);
			}
		}, 2000);
	}
Code:
//MONSTER_CARNIVAL_START = 0X121 opcode
public static byte [] startCPQ(int team, MapleCharacter grupo, MapleCharacter enemigo) {
        MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
        mplew.writeShort(SendOpcode.MONSTER_CARNIVAL_START.getValue());
        mplew.write(team); //team
        mplew.writeShort(grupo.getCP()); //Obtained CP - Used CP
        mplew.writeShort(grupo.getCP()); //Total Obtained CP
        mplew.writeShort(grupo.getTotalCP()); //Obtained CP - Used CP of the team
        mplew.writeShort(grupo.getTotalCP()); //Total Obtained CP of the team
        mplew.writeShort(grupo.getTotalCP()); //Obtained CP - Used CP of the team
        mplew.writeShort(enemigo.getTotalCP()); //Total Obtained CP of the team
        mplew.writeShort(0); //Probably useless nexon poop
        mplew.writeLong(0); //Probably useless nexon poop
        return mplew.getPacket();
    }

Code:
public static byte[] CPUpdate(boolean party, int curCP, int totalCP, int team) { //CPQ
        MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
        if (!party) {
            mplew.writeShort(SendOpcode.MONSTER_CARNIVAL_OBTAINED_CP.getValue());
        } else {
            mplew.writeShort(SendOpcode.MONSTER_CARNIVAL_PARTY_CP.getValue());
            mplew.write(team); //team?
        }
        mplew.writeShort(curCP);
        mplew.writeShort(totalCP);
        return mplew.getPacket();
    }
 
Last edited:
Upvote 0
Skilled Illusionist
Joined
Jul 17, 2010
Messages
333
Reaction score
165
@mixtamal6
Code:
mc.changeMap(map, map.getPortal(redPortal));//p1,p2 members belong to red team(0) by default(@see MapleCharacter)
mc.setTeam(0);
//~~
mc.changeMap(map, map.getPortal(bluePortal));//p2 members still belong to red team
mc.setTeam(1);//o ur 2 l8
i use maplesolaxia v83, in dynastory work good carnival :l use the same packets and opcodes.
Unbelievable. (Oh, you actually did not say that you used the same codes, right?)

As for the CP problem, hmm... how can I guess what the problem is without any codes except packet...?
 
Upvote 0
Back
Top