You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(20) |
Jun
(46) |
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
|
Feb
|
Mar
(86) |
Apr
(77) |
May
(21) |
Jun
(11) |
Jul
(16) |
Aug
(3) |
Sep
|
Oct
|
Nov
|
Dec
|
2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2013 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(48) |
Oct
(1) |
Nov
(4) |
Dec
|
From: Snowdog <sn...@ga...> - 2013-11-15 17:34:08
|
Very little would actually need to be changed. Simply need to create a new GUI Manager that does nothing with the JPanels it’s handed and toggle what GUI Manager gets used based on command line args. Ideally the server side modules should be able to detect the ‘headless’ run state and never create their GUI components to minimize resource usage. Currently this is at the bottom of a long list of ‘to-dos’. The original design was to have the server be headless and connect to it with a dedicated GUI server-controller client. This is possible because the module initialization occurs post connection and the server doesn’t care what modules a client actually has. e.g. the server can play nice with multiple types of clients at the same time. Also would potentially allow servers to connect to and talk to other servers as peers. The existing server GUI was born to facilitate early testing. Though I’m sure some people (*cough* Windows users *cough*) will probably prefer the server having a built-in GUI. Running a GUI server is not going to be required for sure. —Snowdog On Nov 14, 2013, at 5:47 PM, Mark Tarrabain <ma...@ly...> wrote: > Thanks, > > One more thing, also... > > I notice that the server has a GUI.... how major of a change would it > be to make the server work in a headless environment. While many people > may be satisfied with it taking up a window, I would expect that not > everyone would be. Such a headless server need only log text output > normally, and should not have a gui. Ideally, we could use a separate > program which talks to the server on a localhost, and which may act as a > gui environment for people who want to have a user interface over a > server that has no UI. > > Mark > > > On 11/14/2013 04:17 PM, Snowdog wrote: >> I’ll tackle these inline… so see below. >> >> On Nov 14, 2013, at 1:54 PM, Mark Tarrabain <ma...@ly...> wrote: >> >>> Hey, >>> >>> Well, a recent and rather unexpected change in my employment status has >>> opened up my schedule a whole lot, and since I've really wanted to do >>> some work on this, I might as well take advantage of the time I have >>> right now to do so. >> >> Ironically the exact opposite has happened to me. I’m starting a new job and loosing lots of time. :-/ >> >>> So... first things first. >>> >>> It seems there is some sort of logical error in the client-server >>> connectivity, since I cannot seem to disconnect from a server that I've >>> connected to. >> >> The client side network module is new, and admittedly lacks some polish to put _very_ kindly. ;-) >> Yes, there indeed is a disconnection issue. The client/server do indeed disconnect, >> but they do so on their own whims (or so it seems). Its a thread based timing thing i believe. >> The async nature of the network code poses some _significant_ challenges to what >> would be otherwise simple setup/teardown of the network pipe. We have to arbitrarily wait >> while other modules do their syncing before actually shutting down the pipe. >> >> I’ll be the first to admit, sometimes I think I’ve dug myself into a huge hole with this design, >> but other times things slips together so simply and easily I know its going to work great >> down the road. All the hard stuff is up front, once thats handled module writers should >> have a simple time of adding to this design. Till then though… expect to loose hair lol. >> >> >>> Also, it's been a while since I looked at the code here and I'm not sure >>> I'm getting my brain wrapped around how the whole system is structured. >> >> Yeah, the base structure is…. different. Because of the multi-threaded modular nature of the core >> it makes visualizing how things work difficult. I’ll try to boil it down for you. Remember this is all OOD/P so there is little in the way of a ‘flow’ to follow. >> I’ll reference key classes as I go... >> >> Basically, we have 3 subsystems (Layers) that each run in its own thread by the “Engine” (common.core.engine.Engine) >> 1) Network Layer (common.core.network.NetworkServer & common.core.network.NetworkClient) >> The network manages all connections and network I/O using a pool of worker threads >> The network sends/receives ORPGMessages (common.core.ORPGMessage) to/from the Module Layer >> 2) Module Layer >> All features of the system are ‘Modules’, i.e. ‘chat module’, ‘whiteboard module’, etc. >> All modules register with the ModuleManager (common.core.engine.ModuleManager) via the module loader (server.core.ServerModuleLoader & client.core.ClientModuleLoader) >> They register what types of messages they receive & send, register interest in other modules, register gui components, etc with the Module Manager. >> This is a key point…. Modules CANNOT interact directly with other modules, they MUST go through the ModuleManager. >> 3) GUI Layer (common.core.gui.GUIManager) >> All GUI components for registered modules and handled as JPanels by a GUIManager. >> Each panel is controlled and managed by its respective owning module. >> >>> Snowdog, could you please walk me through how the module system works, >>> exactly? What does a client and server have to do to register a >>> module? >> >> Eventually we will be able to dynamically load modules, but currently only ‘core’ static >> modules are loaded via the respective module loader (server.core.ServerModuleLoader & client.core.ClientModuleLoader) >> >> The module loader then instances the module and calls its doRegistration() method (see bottom of ExampleClientModule.java). >> The module class handles it’s own registering with the ModuleManager. >> >>> How does a client module send or receive data from the server, >>> and how does a module on the server send or receive data from clients? >> >> Check out the Example modules (client.core.modules.ExampleClientModule ) >> Messages between the client/server or client/client(s) is accomplished using a simple header/data structure (based on a TCP/IP packet design) >> 1) Create an ORPGMessage >> 2) Set the message type so the receiver(s) know what module this is destined for >> 3) Set any header data [optional, but useful for small messages] >> 4) Set data payload [optional] >> 5) Create a MessageAddress (contains details for delivery of message) and set the destination for the ORPGMessage >> 6) Push the ORPGMessage to the ModuleManager via sendToNetwork() call. >> >> Note: The data payload will be sent as binary so the structure of the data is up to individual modules. >> Could be text, XML, binary, JSON, etc. As the data portion of the message will only be parsed by the >> receiving module (and then only if needed presumably) it greatly cuts down on message parsing times >> (as only header is parsed) >> >>> I am thinking of working on the chat/channel system, if you haven't >>> already started on that. >> >> I have not started on either as all of my work has been much lower level. >> >>> Once that's complete, I will work on a channel-based whiteboard that can >>> be viewed by all within the channel, which will ultimately function as >>> the channel's map. >>> >>> Mark >> >> It should be noted that the server does not need to have a module for a given module. >> As it only parses the message header (for addressing info) it does not NEED to handle the message, >> only route it to the correct client. This means that technically, you only need a client side module for most tasks. >> >> The server contains a special ‘fallback’ module called ‘DefaultRelay’ that accepts all unknown messages and simply forwards them based on their MessageAddress data. >> >> let me know if you need any more info. >> >> >> --Snowdog >> >> >> |
From: Mark T. <ma...@ly...> - 2013-11-15 02:02:58
|
Thanks, One more thing, also... I notice that the server has a GUI.... how major of a change would it be to make the server work in a headless environment. While many people may be satisfied with it taking up a window, I would expect that not everyone would be. Such a headless server need only log text output normally, and should not have a gui. Ideally, we could use a separate program which talks to the server on a localhost, and which may act as a gui environment for people who want to have a user interface over a server that has no UI. Mark On 11/14/2013 04:17 PM, Snowdog wrote: > I’ll tackle these inline… so see below. > > On Nov 14, 2013, at 1:54 PM, Mark Tarrabain <ma...@ly...> wrote: > >> Hey, >> >> Well, a recent and rather unexpected change in my employment status has >> opened up my schedule a whole lot, and since I've really wanted to do >> some work on this, I might as well take advantage of the time I have >> right now to do so. > > Ironically the exact opposite has happened to me. I’m starting a new job and loosing lots of time. :-/ > >> So... first things first. >> >> It seems there is some sort of logical error in the client-server >> connectivity, since I cannot seem to disconnect from a server that I've >> connected to. > > The client side network module is new, and admittedly lacks some polish to put _very_ kindly. ;-) > Yes, there indeed is a disconnection issue. The client/server do indeed disconnect, > but they do so on their own whims (or so it seems). Its a thread based timing thing i believe. > The async nature of the network code poses some _significant_ challenges to what > would be otherwise simple setup/teardown of the network pipe. We have to arbitrarily wait > while other modules do their syncing before actually shutting down the pipe. > > I’ll be the first to admit, sometimes I think I’ve dug myself into a huge hole with this design, > but other times things slips together so simply and easily I know its going to work great > down the road. All the hard stuff is up front, once thats handled module writers should > have a simple time of adding to this design. Till then though… expect to loose hair lol. > > >> Also, it's been a while since I looked at the code here and I'm not sure >> I'm getting my brain wrapped around how the whole system is structured. > > Yeah, the base structure is…. different. Because of the multi-threaded modular nature of the core > it makes visualizing how things work difficult. I’ll try to boil it down for you. Remember this is all OOD/P so there is little in the way of a ‘flow’ to follow. > I’ll reference key classes as I go... > > Basically, we have 3 subsystems (Layers) that each run in its own thread by the “Engine” (common.core.engine.Engine) > 1) Network Layer (common.core.network.NetworkServer & common.core.network.NetworkClient) > The network manages all connections and network I/O using a pool of worker threads > The network sends/receives ORPGMessages (common.core.ORPGMessage) to/from the Module Layer > 2) Module Layer > All features of the system are ‘Modules’, i.e. ‘chat module’, ‘whiteboard module’, etc. > All modules register with the ModuleManager (common.core.engine.ModuleManager) via the module loader (server.core.ServerModuleLoader & client.core.ClientModuleLoader) > They register what types of messages they receive & send, register interest in other modules, register gui components, etc with the Module Manager. > This is a key point…. Modules CANNOT interact directly with other modules, they MUST go through the ModuleManager. > 3) GUI Layer (common.core.gui.GUIManager) > All GUI components for registered modules and handled as JPanels by a GUIManager. > Each panel is controlled and managed by its respective owning module. > >> Snowdog, could you please walk me through how the module system works, >> exactly? What does a client and server have to do to register a >> module? > > Eventually we will be able to dynamically load modules, but currently only ‘core’ static > modules are loaded via the respective module loader (server.core.ServerModuleLoader & client.core.ClientModuleLoader) > > The module loader then instances the module and calls its doRegistration() method (see bottom of ExampleClientModule.java). > The module class handles it’s own registering with the ModuleManager. > >> How does a client module send or receive data from the server, >> and how does a module on the server send or receive data from clients? > > Check out the Example modules (client.core.modules.ExampleClientModule ) > Messages between the client/server or client/client(s) is accomplished using a simple header/data structure (based on a TCP/IP packet design) > 1) Create an ORPGMessage > 2) Set the message type so the receiver(s) know what module this is destined for > 3) Set any header data [optional, but useful for small messages] > 4) Set data payload [optional] > 5) Create a MessageAddress (contains details for delivery of message) and set the destination for the ORPGMessage > 6) Push the ORPGMessage to the ModuleManager via sendToNetwork() call. > > Note: The data payload will be sent as binary so the structure of the data is up to individual modules. > Could be text, XML, binary, JSON, etc. As the data portion of the message will only be parsed by the > receiving module (and then only if needed presumably) it greatly cuts down on message parsing times > (as only header is parsed) > >> I am thinking of working on the chat/channel system, if you haven't >> already started on that. > > I have not started on either as all of my work has been much lower level. > >> Once that's complete, I will work on a channel-based whiteboard that can >> be viewed by all within the channel, which will ultimately function as >> the channel's map. >> >> Mark > > It should be noted that the server does not need to have a module for a given module. > As it only parses the message header (for addressing info) it does not NEED to handle the message, > only route it to the correct client. This means that technically, you only need a client side module for most tasks. > > The server contains a special ‘fallback’ module called ‘DefaultRelay’ that accepts all unknown messages and simply forwards them based on their MessageAddress data. > > let me know if you need any more info. > > > --Snowdog > > > > > > ------------------------------------------------------------------------------ > DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps > OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access > Free app hosting. Or install the open source package on any LAMP server. > Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native! > http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk > _______________________________________________ > Openrpg-v2-dev mailing list > Ope...@li... > https://lists.sourceforge.net/lists/listinfo/openrpg-v2-dev > > > |
From: Snowdog <sn...@ga...> - 2013-11-15 01:21:41
|
I’ll tackle these inline… so see below. On Nov 14, 2013, at 1:54 PM, Mark Tarrabain <ma...@ly...> wrote: > Hey, > > Well, a recent and rather unexpected change in my employment status has > opened up my schedule a whole lot, and since I've really wanted to do > some work on this, I might as well take advantage of the time I have > right now to do so. Ironically the exact opposite has happened to me. I’m starting a new job and loosing lots of time. :-/ > So... first things first. > > It seems there is some sort of logical error in the client-server > connectivity, since I cannot seem to disconnect from a server that I've > connected to. The client side network module is new, and admittedly lacks some polish to put _very_ kindly. ;-) Yes, there indeed is a disconnection issue. The client/server do indeed disconnect, but they do so on their own whims (or so it seems). Its a thread based timing thing i believe. The async nature of the network code poses some _significant_ challenges to what would be otherwise simple setup/teardown of the network pipe. We have to arbitrarily wait while other modules do their syncing before actually shutting down the pipe. I’ll be the first to admit, sometimes I think I’ve dug myself into a huge hole with this design, but other times things slips together so simply and easily I know its going to work great down the road. All the hard stuff is up front, once thats handled module writers should have a simple time of adding to this design. Till then though… expect to loose hair lol. > Also, it's been a while since I looked at the code here and I'm not sure > I'm getting my brain wrapped around how the whole system is structured. Yeah, the base structure is…. different. Because of the multi-threaded modular nature of the core it makes visualizing how things work difficult. I’ll try to boil it down for you. Remember this is all OOD/P so there is little in the way of a ‘flow’ to follow. I’ll reference key classes as I go... Basically, we have 3 subsystems (Layers) that each run in its own thread by the “Engine” (common.core.engine.Engine) 1) Network Layer (common.core.network.NetworkServer & common.core.network.NetworkClient) The network manages all connections and network I/O using a pool of worker threads The network sends/receives ORPGMessages (common.core.ORPGMessage) to/from the Module Layer 2) Module Layer All features of the system are ‘Modules’, i.e. ‘chat module’, ‘whiteboard module’, etc. All modules register with the ModuleManager (common.core.engine.ModuleManager) via the module loader (server.core.ServerModuleLoader & client.core.ClientModuleLoader) They register what types of messages they receive & send, register interest in other modules, register gui components, etc with the Module Manager. This is a key point…. Modules CANNOT interact directly with other modules, they MUST go through the ModuleManager. 3) GUI Layer (common.core.gui.GUIManager) All GUI components for registered modules and handled as JPanels by a GUIManager. Each panel is controlled and managed by its respective owning module. > Snowdog, could you please walk me through how the module system works, > exactly? What does a client and server have to do to register a > module? Eventually we will be able to dynamically load modules, but currently only ‘core’ static modules are loaded via the respective module loader (server.core.ServerModuleLoader & client.core.ClientModuleLoader) The module loader then instances the module and calls its doRegistration() method (see bottom of ExampleClientModule.java). The module class handles it’s own registering with the ModuleManager. > How does a client module send or receive data from the server, > and how does a module on the server send or receive data from clients? Check out the Example modules (client.core.modules.ExampleClientModule ) Messages between the client/server or client/client(s) is accomplished using a simple header/data structure (based on a TCP/IP packet design) 1) Create an ORPGMessage 2) Set the message type so the receiver(s) know what module this is destined for 3) Set any header data [optional, but useful for small messages] 4) Set data payload [optional] 5) Create a MessageAddress (contains details for delivery of message) and set the destination for the ORPGMessage 6) Push the ORPGMessage to the ModuleManager via sendToNetwork() call. Note: The data payload will be sent as binary so the structure of the data is up to individual modules. Could be text, XML, binary, JSON, etc. As the data portion of the message will only be parsed by the receiving module (and then only if needed presumably) it greatly cuts down on message parsing times (as only header is parsed) > I am thinking of working on the chat/channel system, if you haven't > already started on that. I have not started on either as all of my work has been much lower level. > Once that's complete, I will work on a channel-based whiteboard that can > be viewed by all within the channel, which will ultimately function as > the channel's map. > > Mark It should be noted that the server does not need to have a module for a given module. As it only parses the message header (for addressing info) it does not NEED to handle the message, only route it to the correct client. This means that technically, you only need a client side module for most tasks. The server contains a special ‘fallback’ module called ‘DefaultRelay’ that accepts all unknown messages and simply forwards them based on their MessageAddress data. let me know if you need any more info. --Snowdog |
From: Mark T. <ma...@ly...> - 2013-11-14 22:10:02
|
Hey, Well, a recent and rather unexpected change in my employment status has opened up my schedule a whole lot, and since I've really wanted to do some work on this, I might as well take advantage of the time I have right now to do so. So... first things first. It seems there is some sort of logical error in the client-server connectivity, since I cannot seem to disconnect from a server that I've connected to. Also, it's been a while since I looked at the code here and I'm not sure I'm getting my brain wrapped around how the whole system is structured. Snowdog, could you please walk me through how the module system works, exactly? What does a client and server have to do to register a module? How does a client module send or receive data from the server, and how does a module on the server send or receive data from clients? I am thinking of working on the chat/channel system, if you haven't already started on that. Once that's complete, I will work on a channel-based whiteboard that can be viewed by all within the channel, which will ultimately function as the channel's map. Mark |
From: <sno...@us...> - 2013-10-23 21:34:13
|
Revision: 110 http://sourceforge.net/p/openrpg/svn/110 Author: snowdog_ Date: 2013-10-23 21:34:11 +0000 (Wed, 23 Oct 2013) Log Message: ----------- Added rudimentary network module GUI to client. Client no longer auto-connects to local server. Removed unused MainWindow class. Modified Paths: -------------- trunk/src/openrpg2/client/core/ORPGClient.java trunk/src/openrpg2/common/core/network/NetworkClientModule.java Added Paths: ----------- trunk/src/openrpg2/client/core/modules/network/ trunk/src/openrpg2/client/core/modules/network/NetworkClientModuleGUI.java Removed Paths: ------------- trunk/src/openrpg2/client/core/MainWindow.java Deleted: trunk/src/openrpg2/client/core/MainWindow.java =================================================================== --- trunk/src/openrpg2/client/core/MainWindow.java 2013-09-24 03:18:13 UTC (rev 109) +++ trunk/src/openrpg2/client/core/MainWindow.java 2013-10-23 21:34:11 UTC (rev 110) @@ -1,74 +0,0 @@ -/* - * MainWindow.java - * - * Created on July 12, 2005, 11:31 AM - * - * To change this template, choose Tools | Options and locate the template under - * the Source Creation and Management node. Right-click the template and choose - * Open. You can then make changes to the template in the Source Editor. - */ - -package openrpg2.client.core; - -import javax.swing.JFrame; -import java.awt.Toolkit; -import java.awt.Dimension; - - - - -/** - * Container class for the OpenRPG2 main gui window. - * @author snowdog - */ -public class MainWindow { - - /** - * instance of JFrame - */ - protected JFrame mainframe; - - /** Creates a new instance of MainWindow */ - public MainWindow() { - - // CREATE THE MAIN GUI FRAME - mainframe = new JFrame("OpenRPG2 v2.0.1 build 9"); - mainframe.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE); - - - - Toolkit tk = Toolkit.getDefaultToolkit(); - Dimension screen = tk.getScreenSize(); - - // Make full size of screen. - mainframe.setSize((int)screen.getWidth()/2,(int)screen.getHeight()/2); - - mainframe.setLocationRelativeTo(null); //center on screen - - } - - - /** Shows the main window */ - public void show(){ - mainframe.setVisible(true); - } - - /** Hides the main window */ - public void hide(){ - mainframe.setVisible(false); - } - - /** - * Allows for the JFrame object to be accessed from outside package. - * This breaks abstraction rules but may be required by other components - * to simplify GUI construction and avoid creating a complete interface within this class<br> - * <I><B>NOTE</B> Should be used with extreme caution and only when absolutely required for application - * Functionality</I> - * @return reference to internal main window object - */ - - public JFrame getJFrame(){ - return mainframe; - } - -} Modified: trunk/src/openrpg2/client/core/ORPGClient.java =================================================================== --- trunk/src/openrpg2/client/core/ORPGClient.java 2013-09-24 03:18:13 UTC (rev 109) +++ trunk/src/openrpg2/client/core/ORPGClient.java 2013-10-23 21:34:11 UTC (rev 110) @@ -99,10 +99,12 @@ - + /* + * MOVING TO CLIENT NETWORK MODULE if ( ! nc.connect() ){ System.out.println("DEBUG: ORPGClient::execute() connection in NetworkClient failed!!"); } + */ } private void ___DEBUG___SIMULATE_LOADING_TIME(int x){ Added: trunk/src/openrpg2/client/core/modules/network/NetworkClientModuleGUI.java =================================================================== --- trunk/src/openrpg2/client/core/modules/network/NetworkClientModuleGUI.java (rev 0) +++ trunk/src/openrpg2/client/core/modules/network/NetworkClientModuleGUI.java 2013-10-23 21:34:11 UTC (rev 110) @@ -0,0 +1,86 @@ +/* + * NetworkClientModuleGUI.java + * + * Author: Snowdog + * Created: October 22, 2013, 11:00 AM + * + * ==================================================================== + * Copyright (C) 2005-2013 The OpenRPG Project (www.openrpg.com) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This software 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 General Public License on www.gnu.org for more details. + * ==================================================================== + */ +package openrpg2.client.core.modules.network; + +import java.awt.BorderLayout; +import java.awt.Dimension; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import javax.swing.BoxLayout; +import javax.swing.JButton; +import javax.swing.JLabel; +import javax.swing.JPanel; +import javax.swing.JTextField; +import openrpg2.common.core.event.ORPGEvent; +import openrpg2.common.core.network.NetworkClientModule; +import openrpg2.common.core.network.NetworkConnection; + +public class NetworkClientModuleGUI extends JPanel implements ActionListener{ + private JTextField t; + private JButton b1; + private JButton b2; + private JLabel s; + private NetworkClientModule ncm; + public NetworkClientModuleGUI(NetworkClientModule m){ + ncm = m; + this.setLayout(new BorderLayout()); + this.setPreferredSize(new Dimension(300,100)); + JLabel i = new JLabel("Super Simplistic Network Selector"); + this.add(i,BorderLayout.NORTH); + String st = "Status: Not Connected"; + if( m.isConnected() ){ st = "Status: Connected"; } + s = new JLabel(st); + this.add(s,BorderLayout.SOUTH); + this.t = new JTextField(); + this.t.setText(NetworkConnection.DEFAULT_HOST); + this.add(t,BorderLayout.CENTER); + + JPanel bp = new JPanel(); + bp.setLayout(new BoxLayout(bp, BoxLayout.Y_AXIS)); + b1 = new JButton("Connect"); + b1.addActionListener(this); + bp.add(b1); + b2 = new JButton("Disonnect"); + b2.addActionListener(this); + bp.add(b2); + this.add(bp,BorderLayout.EAST); + } + + @Override + public void actionPerformed(ActionEvent e) { + if( this.b1 == e.getSource()){ this.connect(); } + if( this.b2 == e.getSource()){ this.disconnect(); } + } + + public void connect(){ + s.setText("Status: Connecting..."); + if( this.ncm.connectTo(this.t.getText()) ){ + s.setText("Status: Connected"); + }else{ + s.setText("Status: Connection Failed!"); + } + } + public void disconnect(){ + s.setText("Status: Disconnecting..."); + if( this.ncm.disconnect()){ s.setText("Status: Disconnected"); } + else{ s.setText("Status: Disconnect Error!"); } + } +} Modified: trunk/src/openrpg2/common/core/network/NetworkClientModule.java =================================================================== --- trunk/src/openrpg2/common/core/network/NetworkClientModule.java 2013-09-24 03:18:13 UTC (rev 109) +++ trunk/src/openrpg2/common/core/network/NetworkClientModule.java 2013-10-23 21:34:11 UTC (rev 110) @@ -21,10 +21,12 @@ package openrpg2.common.core.network; +import java.net.InetSocketAddress; import java.util.Observable; import java.util.Observer; import java.util.logging.Level; import java.util.logging.Logger; +import openrpg2.client.core.modules.network.NetworkClientModuleGUI; import openrpg2.common.core.ORPGConstants; import openrpg2.common.core.ORPGMessage; import openrpg2.common.core.engine.ModuleCommunicationException; @@ -59,10 +61,13 @@ private NetworkClient network = null; private int networkId = 0; - + private NetworkClientModuleGUI guiPanel; /** Creates a new instance of NetworkClientModule */ public NetworkClientModule(NetworkClient networkReference ) { network = networkReference; + this.guiPanel = new NetworkClientModuleGUI(this); + this.setModuleAuthor("Snowdog"); + this.setModuleShortDescription("Core Network Module"); } @Override @@ -71,7 +76,8 @@ modCom.registerMessageType(ORPGConstants.TYPE_NETWORK, this); this.modCom.registerEventSender(this, NetworkClientModule.EVENT_JOINED_SERVER); this.modCom.registerEventSender(this, NetworkClientModule.EVENT_DISCONNECT); - + + this.modCom.registerGUIComponent("Network", this.guiPanel); } @Override @@ -111,7 +117,7 @@ * with a NOOP message. */ private void handleHeartbeatMessage(){ - System.out.println("heartbeat requested!"); + //System.out.println("heartbeat requested!"); ORPGMessage m = new ORPGMessage(); m.setMessageType(ORPGConstants.TYPE_NETWORK); m.setHeader(NetworkClientModule.HEADER_OP, NetworkClientModule.OP_NOOP); @@ -141,7 +147,27 @@ this.log.finer("Server connection Id set to "+this.networkId); System.out.println("id = "+this.networkId); } + + public boolean isConnected(){ + if( this.network == null){ return false; } + return this.network.isConnected(); + } + + public boolean connectTo(String ipaddress){ + return this.network.connect(new InetSocketAddress(ipaddress, NetworkConnection.DEFAULT_PORT)); + } + public boolean disconnect(){ + ORPGEvent e = new ORPGEvent(this, NetworkClientModule.EVENT_DISCONNECT); + this.modCom.generateEvent(e); //notify other modules of DISCONNECT event. + + System.err.println("DISCONNECT FUNCTION INCOMPLETE!"); + //TODO a) perhaps a pause here to allow modules time to do any tasks due to disconnect. + //TODO b) send a message to the server indicating our intent to disconnect (server will tell other clients) + this.network.disconnect(); + return this.network.isConnected(); + + } /** * Observer callback function for network changes. * @param o NetworkConnectionAlerter object (ignored) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sno...@us...> - 2013-09-24 03:18:16
|
Revision: 109 http://sourceforge.net/p/openrpg/svn/109 Author: snowdog_ Date: 2013-09-24 03:18:13 +0000 (Tue, 24 Sep 2013) Log Message: ----------- Fixed issue with NOOP message in heartbeat code. Modified Paths: -------------- trunk/src/openrpg2/common/core/network/NetworkServer.java Modified: trunk/src/openrpg2/common/core/network/NetworkServer.java =================================================================== --- trunk/src/openrpg2/common/core/network/NetworkServer.java 2013-09-23 23:42:28 UTC (rev 108) +++ trunk/src/openrpg2/common/core/network/NetworkServer.java 2013-09-24 03:18:13 UTC (rev 109) @@ -82,8 +82,8 @@ static final String SETTING_DEFAULT_PORT = "defaultPort"; private int threadPoolSize = DEFAULT_THREAD_POOL_SIZE; static final int NETWORK_TIMEOUT = 300; //5 mins - static final int NETWORK_NOOP_LIMIT = 20;//180; //3 mins - static final int NETWORK_SWEEP_LIMIT = 10;//limit to every 10 seconds + static final int NETWORK_NOOP_LIMIT = 180; //3 mins + static final int NETWORK_SWEEP_LIMIT = 15;//limit to every 15 seconds /** @@ -426,29 +426,28 @@ long last = (Calendar.getInstance().getTimeInMillis() - this.lastSweep)/1000; if( last < (long)NetworkServer.NETWORK_SWEEP_LIMIT){ return; } //not time to sweep yet, bailout - System.out.println("Sweeping System!"); Enumeration en = clients.keys(); while(en.hasMoreElements()){ Integer i = (Integer)en.nextElement(); NetworkConnection n = (NetworkConnection)clients.get(i); //if connection has no activity inbound for NETWORK_TIMEOUT seconds... disconnect the client. int delta = n.stats.getInboundMessageDelta()/1000; - System.out.println("- Client "+n.getId()+" delta: "+delta); if( delta > NetworkServer.NETWORK_TIMEOUT){ - System.out.println("[DEBUG] SHOULD BE Disconnecting!! "+NetworkServer.NETWORK_TIMEOUT+" seconds"); - //n.disconnect(); + log.info("Client #"+n.getId()+" has timed out. Disconnecting."); + n.disconnect(); }else{ if( delta >= NetworkServer.NETWORK_NOOP_LIMIT){ //fabricate a network NOOP message and push it into the send queue - System.out.println("Sending NOOP to client "+n.getId()); ORPGMessage m = new ORPGMessage(); m.setMessageType(ORPGConstants.TYPE_NETWORK); m.setHeader(NetworkClientModule.HEADER_OP, NetworkClientModule.OP_NOOP); - MessageAddress ma = new MessageAddress(); - ma.append(new AddressToken(n.getId())); - m.setDestination(ma); - System.out.println("NOOP MESSAGE: "+m.getAsString()); + m.setDestination(new MessageAddress(new AddressToken(n.getId()))); + //this message does not pass through the RouteManager address checks + //so we have to manually set the destination array or message will not be deliverable + int[] dests = new int[]{n.getId()}; + m.setFinalRecipientList(dests); + log.finer("Requesting heartbeat from client #"+n.getId()); sendMessage(m); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sno...@us...> - 2013-09-23 23:42:32
|
Revision: 108 http://sourceforge.net/p/openrpg/svn/108 Author: snowdog_ Date: 2013-09-23 23:42:28 +0000 (Mon, 23 Sep 2013) Log Message: ----------- Adding heartbeat & disconnection monitoring to server. Discovered a bug in message address handling that is causing client addresses to not be included in message header info. Currently actively debugging. Modified Paths: -------------- trunk/src/openrpg2/common/core/network/NetworkClientModule.java trunk/src/openrpg2/common/core/network/NetworkServer.java Modified: trunk/src/openrpg2/common/core/network/NetworkClientModule.java =================================================================== --- trunk/src/openrpg2/common/core/network/NetworkClientModule.java 2013-09-23 23:21:49 UTC (rev 107) +++ trunk/src/openrpg2/common/core/network/NetworkClientModule.java 2013-09-23 23:42:28 UTC (rev 108) @@ -79,7 +79,7 @@ //NOTE messages of this type ALWAYS come from the server int operation = Integer.parseInt(msg.getHeader(HEADER_OP)); switch(operation){ - case(NetworkClientModule.OP_NOOP):{ break; } + case(NetworkClientModule.OP_NOOP):{ handleHeartbeatMessage(); break; } case(NetworkClientModule.OP_DISCONNECT):{ handleDisconnectMessage(msg);break; } case(NetworkClientModule.OP_ALERT):{ handleAlertMessage(msg); break; } case(NetworkClientModule.OP_SHUTDOWN):{ handleShutdownMessage(msg); break; } @@ -104,6 +104,26 @@ } } + /** + * The server will send a NOOP message when it thinks the connection is getting + * stale and it expects a response to update its connection timer(s) for the + * clients connection. This method simply forces a response to the server request + * with a NOOP message. + */ + private void handleHeartbeatMessage(){ + System.out.println("heartbeat requested!"); + ORPGMessage m = new ORPGMessage(); + m.setMessageType(ORPGConstants.TYPE_NETWORK); + m.setHeader(NetworkClientModule.HEADER_OP, NetworkClientModule.OP_NOOP); + m.setDestination( ORPGConstants.TO_SERVER ); + try { + this.modCom.sendToNetwork(m); + } catch (ModuleCommunicationException ex) { + Logger.getLogger(NetworkClientModule.class.getName()).log(Level.SEVERE, null, ex); + } + } + + private void handleDisconnectMessage(ORPGMessage msg){ //TODO: handle notification of rest of ORPG2 system when a client sends a disconnect message } Modified: trunk/src/openrpg2/common/core/network/NetworkServer.java =================================================================== --- trunk/src/openrpg2/common/core/network/NetworkServer.java 2013-09-23 23:21:49 UTC (rev 107) +++ trunk/src/openrpg2/common/core/network/NetworkServer.java 2013-09-23 23:42:28 UTC (rev 108) @@ -29,6 +29,7 @@ import java.nio.channels.SelectionKey; import java.nio.channels.Selector; import java.nio.channels.ServerSocketChannel; +import java.util.Calendar; import java.util.Enumeration; import java.util.Hashtable; import java.util.Iterator; @@ -37,9 +38,12 @@ import java.util.Properties; import java.util.Set; import java.util.logging.Logger; +import openrpg2.common.core.ORPGConstants; import openrpg2.common.core.ORPGMessage; import openrpg2.common.core.ORPGMessageQueue; import openrpg2.common.core.ORPGSettingManager; +import openrpg2.common.core.route.AddressToken; +import openrpg2.common.core.route.MessageAddress; import openrpg2.common.module.NetworkedModule; @@ -47,8 +51,8 @@ * Network Server. This class represents the interface between all network * functions of the OpenRPG server and the remainder of the application. * This is intended to be a black-box object such that network operations are - * wholely contained and implemented within this object. All interaction with - * the network functions of OpenRPG should occure though this objects API. + * contained and implemented within this object. All interaction with + * the network functions of OpenRPG should occur though this objects API. * @author snowdog */ @@ -70,12 +74,16 @@ private Object monitorLock = new Object(); private NetworkConnectionAlerter connectionState = new NetworkConnectionAlerter(); private Logger log = Logger.getLogger(this.getClass().getName()); - + private long lastSweep = 0L; + static final int DEFAULT_THREAD_POOL_SIZE = 5; static final String SERVER_SETTINGS_FILENAME = "server.properties"; static final String SETTING_DEFAULT_IP = "defaultIP"; static final String SETTING_DEFAULT_PORT = "defaultPort"; private int threadPoolSize = DEFAULT_THREAD_POOL_SIZE; + static final int NETWORK_TIMEOUT = 300; //5 mins + static final int NETWORK_NOOP_LIMIT = 20;//180; //3 mins + static final int NETWORK_SWEEP_LIMIT = 10;//limit to every 10 seconds /** @@ -101,7 +109,9 @@ } /** - * Gets the default ip and port to run the server on by checking for user perferences first and then falling back on the hard coded defaults if no preferences exist. + * Gets the default IP address and port to run the server on by checking + * for user preferences first and then falling back on the hard coded + * defaults if no preferences exist. * @return InetSocketAddress to run server on. */ public InetSocketAddress getDefaultAddress(){ @@ -203,7 +213,7 @@ */ private void delegateMessageDelivery(ORPGMessage m){ NetworkServiceThread nst=null; - + //get a message to handle and its associated recipient list int[] destId = m.getFinalRecipientList(); @@ -314,6 +324,8 @@ // after the 1 second delay on the selector readiness scan // // server should be considered "idle" in this situation + + performNetworkSweep(); //use idle time to cleanup dead connections and prevent zombies. } } log.finer("[DEBUG] Main select thread terminating"); @@ -321,9 +333,6 @@ }; serverThread.start(); startOutboundMonitor(); - - - } /** @@ -366,6 +375,7 @@ inQueue.putMessage(msg); } + @Override public Observable addMessageQueueObserver(Observer o){ inQueue.addObserver(o); return outQueue; //return reference to object for comparison only in case more than one observable is being monitored. @@ -402,7 +412,54 @@ return runFlag; } + /** + * This method performs a scans over the connected client sockets + * and forces the send of a network NOOP message (aka heartbeat) + * based on their last message received time. This catches clients + * who have crashed or otherwise severed the socket connection without + * properly informing the server of the shutdown. + */ + private void performNetworkSweep(){ + if( clients.isEmpty()){ return; }//nothing to do! + + //check last sweep time to make sure we don't over-sweep + long last = (Calendar.getInstance().getTimeInMillis() - this.lastSweep)/1000; + if( last < (long)NetworkServer.NETWORK_SWEEP_LIMIT){ return; } //not time to sweep yet, bailout + + System.out.println("Sweeping System!"); + Enumeration en = clients.keys(); + while(en.hasMoreElements()){ + Integer i = (Integer)en.nextElement(); + NetworkConnection n = (NetworkConnection)clients.get(i); + //if connection has no activity inbound for NETWORK_TIMEOUT seconds... disconnect the client. + int delta = n.stats.getInboundMessageDelta()/1000; + System.out.println("- Client "+n.getId()+" delta: "+delta); + + if( delta > NetworkServer.NETWORK_TIMEOUT){ + System.out.println("[DEBUG] SHOULD BE Disconnecting!! "+NetworkServer.NETWORK_TIMEOUT+" seconds"); + //n.disconnect(); + }else{ + if( delta >= NetworkServer.NETWORK_NOOP_LIMIT){ + //fabricate a network NOOP message and push it into the send queue + System.out.println("Sending NOOP to client "+n.getId()); + ORPGMessage m = new ORPGMessage(); + m.setMessageType(ORPGConstants.TYPE_NETWORK); + m.setHeader(NetworkClientModule.HEADER_OP, NetworkClientModule.OP_NOOP); + MessageAddress ma = new MessageAddress(); + ma.append(new AddressToken(n.getId())); + m.setDestination(ma); + System.out.println("NOOP MESSAGE: "+m.getAsString()); + sendMessage(m); + } + } + } + //reset sweep time + this.lastSweep = Calendar.getInstance().getTimeInMillis(); + } + + //methods to satisfy NetworkMessageRelay interface + @Override public boolean putORPGMessage(ORPGMessage msg){ sendMessage(msg); return true; @@ -412,6 +469,7 @@ * @throws openrpg2.common.core.network.NoMessageAvailableException Thrown if no messages are available for retrieval * @return ORPGMessage object */ + @Override public ORPGMessage getORPGMessage() throws NoMessageAvailableException{ ORPGMessage msg = inQueue.pullMessage(); if (msg == null){ throw new NoMessageAvailableException(); } @@ -421,6 +479,7 @@ * Check if ORPGMessage can be retrieved with getORPGMessage() method * @return True if 1 or more ORPGMessages are ready for retrieval otherwise false. */ + @Override public boolean hasORPGMessage(){ if (inQueue.hasRemaining()) return true; return false; @@ -431,6 +490,7 @@ * Allows other core components to be notified when a client connects or disconnects. * @param o An Observer Object to register for network state notification */ + @Override public void registerNetworkConnectionObserver(Observer o){ connectionState.addObserver(o); @@ -441,6 +501,7 @@ * Required for implementation of NetworkModuleProvider interface. * */ + @Override public NetworkedModule getNetworkModule(){ return new NetworkServerModule(this); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sno...@us...> - 2013-09-23 23:21:53
|
Revision: 107 http://sourceforge.net/p/openrpg/svn/107 Author: snowdog_ Date: 2013-09-23 23:21:49 +0000 (Mon, 23 Sep 2013) Log Message: ----------- Fixes to connection stats timing methods Modified Paths: -------------- trunk/src/openrpg2/common/core/network/ConnectionStats.java Modified: trunk/src/openrpg2/common/core/network/ConnectionStats.java =================================================================== --- trunk/src/openrpg2/common/core/network/ConnectionStats.java 2013-09-23 18:34:21 UTC (rev 106) +++ trunk/src/openrpg2/common/core/network/ConnectionStats.java 2013-09-23 23:21:49 UTC (rev 107) @@ -29,7 +29,6 @@ */ -import java.util.Date; import java.util.Calendar; /** @@ -46,13 +45,11 @@ private long lastOut; private long inMessages; private long outMessages; - private Calendar cal; /** * Creates a new instance of ConnectionStats */ public ConnectionStats() { - cal = Calendar.getInstance(); clear(); } @@ -60,14 +57,14 @@ * Sets the time when the connection was established */ public void setConnectionTime(){ - connectionStart = cal.getTimeInMillis(); + connectionStart = Calendar.getInstance().getTimeInMillis(); } /** * Marks a moment in time for later calculations */ public void setTimeMark(){ - connectionMark = cal.getTimeInMillis(); + connectionMark = Calendar.getInstance().getTimeInMillis(); } /** @@ -82,7 +79,7 @@ public long getConnectionDuration(){ if (connectionStart == 0){ return 0L; } if (connectionMark > connectionStart ){ return connectionMark - connectionStart; } - return cal.getTimeInMillis() - connectionStart; + return Calendar.getInstance().getTimeInMillis() - connectionStart; } @@ -90,22 +87,24 @@ * Informs the ConnectionStats object of a socket message it should track. * Inbound socket message time is automatically updated internally on each * call to AddInbound. - * @param msgSize The number of bytes of an inbound message. Interal inbound byte counter is incremented by <CODE>msgSize</CODE> bytes. + * @param msgSize The number of bytes of an inbound message. Interval inbound + * byte counter is incremented by <CODE>msgSize</CODE> bytes. */ public void addInbound( long msgSize ){ inBytes += msgSize; - cal.setTime( new Date() ); - lastIn = cal.getTimeInMillis(); + lastIn = Calendar.getInstance().getTimeInMillis(); } /** - * Informs the ConnectionStats object of a socket message it should track. Outbound socket message time is automatically updated internally on each call to AddOutbound. - * @param msgSize The number of bytes of an outbound message. Interal outbound byte counter is incremented by <CODE>msgSize</CODE> bytes. + * Informs the ConnectionStats object of a socket message it should track. + * Outbound socket message time is automatically updated internally on each + * call to AddOutbound. + * @param msgSize The number of bytes of an outbound message. + * Interval outbound byte counter is incremented by <CODE>msgSize</CODE> bytes. */ public void addOutbound( long msgSize ){ outBytes += msgSize; - cal.setTime( new Date() ); - lastOut = cal.getTimeInMillis(); + lastOut = Calendar.getInstance().getTimeInMillis(); } /** @@ -116,9 +115,9 @@ outBytes = 0L; - cal.setTime(new Date() ); - lastIn = cal.getTimeInMillis(); - lastOut = cal.getTimeInMillis(); + long time = Calendar.getInstance().getTimeInMillis(); + lastIn = time; + lastOut = time; connectionMark = 0; connectionStart = 0; inMessages = 0; @@ -142,32 +141,35 @@ } /** - * This method can be used to test for timeout or delay conditions based on the ConnectionStats object's internal timers. The timers are automatically updated by calls to the AddInbound and AddOutbound methods and represent the last time when a socket message was reported to the object. + * This method can be used to test for timeout or delay conditions based on + * the ConnectionStats object's internal timers. The timers are automatically + * updated by calls to the AddInbound and AddOutbound methods and represent + * the last time when a socket message was reported to the object. * @param seconds The number of seconds of inactivity at which the method will return a <B>false</B> * @return <B>true</B> if network activity has been reported within the last X seconds. */ public boolean isActive(int seconds){ //convert seconds to milliseconds long ms = (long)seconds * 1000L; - if ( (lastIn+ms)<cal.getTimeInMillis() ) { return true; } + if ( (lastIn+ms)<Calendar.getInstance().getTimeInMillis() ) { return true; } return false; } /** - * Reports the time in seconds since the last inbound message was recorded in the object. + * Reports the time in milliseconds since the last inbound message was recorded in the object. * @return inbound message offset (milliseconds) */ public int getInboundMessageDelta(){ - int delta = (int)(cal.getTimeInMillis() - lastIn); + int delta = (int)(Calendar.getInstance().getTimeInMillis() - lastIn); return (int)delta; } /** - * Reports the time in seconds since the last outbound message was recorded in the object. + * Reports the time in milliseconds since the last outbound message was recorded in the object. * @return outbound message offset (milliseconds) */ public int getOutboundMessageDelta(){ - int delta =(int) (cal.getTimeInMillis() - lastOut); + int delta =(int) (Calendar.getInstance().getTimeInMillis() - lastOut); return delta; } @@ -203,8 +205,8 @@ } /** - * Retreives the total message count by summing both the inbound and outbound counters. - * @return total number of messages sent and recieved as a long integer + * Retrieves the total message count by summing both the inbound and outbound counters. + * @return total number of messages sent and received as a long integer */ public long getTotalMessageCount(){ return getInboundMessageCount()+getOutboundMessageCount(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sno...@us...> - 2013-09-23 18:34:24
|
Revision: 106 http://sourceforge.net/p/openrpg/svn/106 Author: snowdog_ Date: 2013-09-23 18:34:21 +0000 (Mon, 23 Sep 2013) Log Message: ----------- Refresh ClientList GUI on events Modified Paths: -------------- trunk/src/openrpg2/server/core/modules/clientlist/ClientList.java Modified: trunk/src/openrpg2/server/core/modules/clientlist/ClientList.java =================================================================== --- trunk/src/openrpg2/server/core/modules/clientlist/ClientList.java 2013-09-23 18:01:57 UTC (rev 105) +++ trunk/src/openrpg2/server/core/modules/clientlist/ClientList.java 2013-09-23 18:34:21 UTC (rev 106) @@ -79,6 +79,7 @@ public void notifyOfModuleEvent(ORPGEvent e) { // this.log.info("Got event notification "+e.src()+" i="+e.id); this.dataSource.updateData(); + this.dataSource.fireTableDataChanged(); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sno...@us...> - 2013-09-23 18:01:59
|
Revision: 105 http://sourceforge.net/p/openrpg/svn/105 Author: snowdog_ Date: 2013-09-23 18:01:57 +0000 (Mon, 23 Sep 2013) Log Message: ----------- Added initialize method to BaseModule for code clarity Modified Paths: -------------- trunk/src/openrpg2/common/module/BaseModule.java trunk/src/openrpg2/server/core/modules/clientlist/ClientList.java Modified: trunk/src/openrpg2/common/module/BaseModule.java =================================================================== --- trunk/src/openrpg2/common/module/BaseModule.java 2013-09-23 02:22:54 UTC (rev 104) +++ trunk/src/openrpg2/common/module/BaseModule.java 2013-09-23 18:01:57 UTC (rev 105) @@ -75,10 +75,22 @@ */ public void register(ModuleCommunicator mc){ modCom = mc; //hooks module to module manager + initialize(); doRegistration(); } /** + * The initialize method allows a module to do operations post module load + * but before registration is done. This is particularly useful when + * GUI components interact with the ModuleCommunicator indirectly. While + * technically speaking these kind of operations can be done at the top of + * the doRegistration method the initialize method makes the code a bit clearer + * by separating module initialization code from the module registration code. + * <i>Overriding this method is optional</i> + */ + protected void initialize(){} + + /** * This method handles registration tasks that relate to the overseeing ModuleCommunicator object. * These tasks generally include registering message handlers and informing the ModuleCommunicator of a * modules abilities and external interests. Modified: trunk/src/openrpg2/server/core/modules/clientlist/ClientList.java =================================================================== --- trunk/src/openrpg2/server/core/modules/clientlist/ClientList.java 2013-09-23 02:22:54 UTC (rev 104) +++ trunk/src/openrpg2/server/core/modules/clientlist/ClientList.java 2013-09-23 18:01:57 UTC (rev 105) @@ -43,10 +43,6 @@ public ClientList(){ this.setModuleAuthor("Snowdog"); this.setModuleShortDescription("Client List for Server"); - - buildGUI(); - - log.info("Module Instanced."); } private void buildGUI(){ @@ -60,6 +56,12 @@ table.setFillsViewportHeight(false); panel.add(sp, BorderLayout.CENTER); } + + @Override + protected void initialize(){ + this.dataSource = new ClientListTableModel(this.modCom); + buildGUI(); + } @Override protected void doRegistration() { @@ -70,7 +72,7 @@ @Override public void activate(){ - this.dataSource = new ClientListTableModel(this.modCom); + } @Override This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sno...@us...> - 2013-09-23 02:22:59
|
Revision: 104 http://sourceforge.net/p/openrpg/svn/104 Author: snowdog_ Date: 2013-09-23 02:22:54 +0000 (Mon, 23 Sep 2013) Log Message: ----------- Fixed Null Pointer Exception in ClientList Modified Paths: -------------- trunk/src/openrpg2/common/core/group/GroupServerModule.java trunk/src/openrpg2/server/core/modules/clientlist/ClientList.java trunk/src/openrpg2/server/core/modules/clientlist/ClientListTableModel.java Modified: trunk/src/openrpg2/common/core/group/GroupServerModule.java =================================================================== --- trunk/src/openrpg2/common/core/group/GroupServerModule.java 2013-09-20 03:17:23 UTC (rev 103) +++ trunk/src/openrpg2/common/core/group/GroupServerModule.java 2013-09-23 02:22:54 UTC (rev 104) @@ -212,10 +212,12 @@ switch(e.id){ case(NetworkServerModule.EVENT_CLIENT_JOIN):{ groupManager.clientConnect(cid); + sendEventChanged(); break; } case(NetworkServerModule.EVENT_CLIENT_DISCONNECT):{ groupManager.clientDisconnect(cid); + sendEventChanged(); break; } Modified: trunk/src/openrpg2/server/core/modules/clientlist/ClientList.java =================================================================== --- trunk/src/openrpg2/server/core/modules/clientlist/ClientList.java 2013-09-20 03:17:23 UTC (rev 103) +++ trunk/src/openrpg2/server/core/modules/clientlist/ClientList.java 2013-09-23 02:22:54 UTC (rev 104) @@ -44,8 +44,6 @@ this.setModuleAuthor("Snowdog"); this.setModuleShortDescription("Client List for Server"); - this.dataSource = new ClientListTableModel(this.modCom); - buildGUI(); log.info("Module Instanced."); @@ -58,12 +56,9 @@ table = new JTable(this.dataSource); - JScrollPane sp = new JScrollPane(table); table.setFillsViewportHeight(false); panel.add(sp, BorderLayout.CENTER); - - } @Override @@ -72,10 +67,15 @@ this.modCom.registerEventInterest(this, GroupServerModule.class.getSimpleName(), GroupServerModule.EVENT_GROUPDATA_CHANGED); } - + @Override + public void activate(){ + this.dataSource = new ClientListTableModel(this.modCom); + } + + @Override public void notifyOfModuleEvent(ORPGEvent e) { - this.log.info("Got event notification "+e.src()+" i="+e.id); + // this.log.info("Got event notification "+e.src()+" i="+e.id); this.dataSource.updateData(); } Modified: trunk/src/openrpg2/server/core/modules/clientlist/ClientListTableModel.java =================================================================== --- trunk/src/openrpg2/server/core/modules/clientlist/ClientListTableModel.java 2013-09-20 03:17:23 UTC (rev 103) +++ trunk/src/openrpg2/server/core/modules/clientlist/ClientListTableModel.java 2013-09-23 02:22:54 UTC (rev 104) @@ -35,8 +35,9 @@ public void updateData(){ + if( this.mc == null){ Logger.getLogger(ClientListTableModel.class.getName()).log(Level.SEVERE, "Module Communicator Reference NULL"); return; } try { - rowData = (ArrayList<HashMap>)this.mc.requestModuleAction("GroupServerModule", GroupServerModule.ACTION_GET_INFO, null); + rowData = (ArrayList<HashMap>)this.mc.requestModuleAction("GroupServerModule", GroupServerModule.ACTION_GET_INFO, null); } catch (NoSuchModuleException ex) { Logger.getLogger(ClientListTableModel.class.getName()).log(Level.SEVERE, ex.getMessage(), ex); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mar...@us...> - 2013-09-20 03:17:25
|
Revision: 103 http://sourceforge.net/p/openrpg/svn/103 Author: markt1964 Date: 2013-09-20 03:17:23 +0000 (Fri, 20 Sep 2013) Log Message: ----------- Fixed logical error in ProdExpr where details would always show "*" even when there was only one factor in the expression Modified Paths: -------------- trunk/src/openrpg2/common/dice/ProdExpr.java Modified: trunk/src/openrpg2/common/dice/ProdExpr.java =================================================================== --- trunk/src/openrpg2/common/dice/ProdExpr.java 2013-09-18 23:07:11 UTC (rev 102) +++ trunk/src/openrpg2/common/dice/ProdExpr.java 2013-09-20 03:17:23 UTC (rev 103) @@ -134,6 +134,7 @@ { result.append('('); } + product = false; for(DiceExpression j:denominator) { if (product) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: Mark T. <ma...@ly...> - 2013-09-18 23:11:49
|
Okay... I tried doing a fresh checkout and then applied my changes to the new checkout and everything worked. The old one must have gotten corrupted somehow. Mark On 09/18/2013 02:25 PM, Snowdog wrote: > I've double checked the sf admin pages for the SVN tool permissions and the 'Developer (ORPG2)' group [that your a member of] is set to have write (commit) access to the svn. > > Most of the hits for that error on google seem to revolve around a case issue (the repository/path is case sensitive), so check your settings on that. It should be all lower case. Looks like some of the SVN apps (ex. TortoiseSVN) are prone to this. > > Let me know if you still can't get it sorted out. > > > On Sep 17, 2013, at 4:46 PM, Mark Tarrabain <ma...@ly...> wrote: > >> Nope... it's giving me a 'access to /p/openrpg/svn/!svn/me' forbidden >> message. >> >> Mark >> >> On 09/17/2013 09:11 AM, Snowdog wrote: >>> Try now. Looks like when sf rolled to its current system some of the permissions got reset. >>> You should have access for write now. >>> --Snowdog >>> >>> On Sep 16, 2013, at 10:54 PM, Mark Tarrabain <ma...@ly...> wrote: >>> >>>> Hmmm.... I don't seem to have write-access to the svn repo anymore. >>>> >>>> Thoughts? >>>> >>>> Mark >>>> >>> >>> >>> >>> >>> >>> ------------------------------------------------------------------------------ >>> LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99! >>> 1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint >>> 2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes >>> Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13. >>> http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk >>> _______________________________________________ >>> Openrpg-v2-dev mailing list >>> Ope...@li... >>> https://lists.sourceforge.net/lists/listinfo/openrpg-v2-dev >>> >>> >> >> >> ------------------------------------------------------------------------------ >> LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99! >> 1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint >> 2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes >> Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13. >> http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk >> _______________________________________________ >> Openrpg-v2-dev mailing list >> Ope...@li... >> https://lists.sourceforge.net/lists/listinfo/openrpg-v2-dev > > > --Snowdog > > > > > > ------------------------------------------------------------------------------ > LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99! > 1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint > 2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes > Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13. > http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk > _______________________________________________ > Openrpg-v2-dev mailing list > Ope...@li... > https://lists.sourceforge.net/lists/listinfo/openrpg-v2-dev > > |
From: <mar...@us...> - 2013-09-18 23:07:14
|
Revision: 102 http://sourceforge.net/p/openrpg/svn/102 Author: markt1964 Date: 2013-09-18 23:07:11 +0000 (Wed, 18 Sep 2013) Log Message: ----------- Complete rewrite of dice rolling code Added Paths: ----------- trunk/src/openrpg2/common/dice/ trunk/src/openrpg2/common/dice/CompareExpr.java trunk/src/openrpg2/common/dice/Const.java trunk/src/openrpg2/common/dice/DiceExpression.java trunk/src/openrpg2/common/dice/DiceParser.java trunk/src/openrpg2/common/dice/DieFunction.java trunk/src/openrpg2/common/dice/Function.java trunk/src/openrpg2/common/dice/MultiDice.java trunk/src/openrpg2/common/dice/MultiValue.java trunk/src/openrpg2/common/dice/MultiValueFunction.java trunk/src/openrpg2/common/dice/NegExpr.java trunk/src/openrpg2/common/dice/ProdExpr.java trunk/src/openrpg2/common/dice/Scanner.java trunk/src/openrpg2/common/dice/SumExpr.java trunk/src/openrpg2/common/dice/TestExpr.java trunk/src/openrpg2/common/dice/UniValue.java trunk/src/openrpg2/common/dice/UniValueFunction.java Removed Paths: ------------- trunk/src/openrpg2/common/dice/ Added: trunk/src/openrpg2/common/dice/CompareExpr.java =================================================================== --- trunk/src/openrpg2/common/dice/CompareExpr.java (rev 0) +++ trunk/src/openrpg2/common/dice/CompareExpr.java 2013-09-18 23:07:11 UTC (rev 102) @@ -0,0 +1,194 @@ +/* + * ==================================================================== + * Copyright (C) 2005-2006 The OpenRPG Project (www.openrpg.com) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This software 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 General Public License on www.gnu.org for more details. + * ==================================================================== + */ + +package openrpg2.common.dice; + + +/** + * + * @author markt + */ +public abstract class CompareExpr implements DiceExpression { + /** + * Left and right hand sides of this expression + */ + protected DiceExpression left,right; + /** + * Name for the comparitor operator in this expression + */ + protected String name; + + /** + * + * @return 0 + */ + public int getValue() + { + return 0; + } + + /** + * + * @return text form of this compare expresssion + */ + public String getText() + { + return left.getText()+name+right.getText(); + } + + /** + * + * @return text form of this compare expresssion + */ + public String getTextDetail() + { + return left.getTextDetail()+name+right.getTextDetail(); + } + + /** + * Executes both sides of this compare expression + */ + public void exec() + { + left.exec(); + right.exec(); + } + + /** + * Compare Expression constructor + * @param l left hand side + * @param r right hand side + */ + public CompareExpr(DiceExpression l,DiceExpression r) + { + left=l; + right=r; + } + + /** + * Performs the actual comparison test + * @return true if the test is successful, false otherwise + */ + public abstract boolean test(); + + /** + * Invalid for comparison functions + * @return nothing, throws an exception + */ + public DiceExpression negate() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + +} +class CompareL extends CompareExpr +{ + public CompareL(DiceExpression l,DiceExpression r) + { + super(l,r); + name="<"; + } + + public boolean test() + { + return left.getValue()<right.getValue(); + } +} + +class CompareG extends CompareExpr +{ + public CompareG(DiceExpression l,DiceExpression r) + { + super(l,r); + name=">"; + } + + public boolean test() + { + return left.getValue()>right.getValue(); + } +} + +class CompareLE extends CompareExpr +{ + public CompareLE(DiceExpression l,DiceExpression r) + { + super(l,r); + name="<="; + } + + public boolean test() + { + return left.getValue()<=right.getValue(); + } +} + +class CompareGE extends CompareExpr +{ + public CompareGE(DiceExpression l,DiceExpression r) + { + super(l,r); + name=">="; + } + + public boolean test() + { + return left.getValue()>=right.getValue(); + } +} + +class CompareE extends CompareExpr +{ + public CompareE(DiceExpression l,DiceExpression r) + { + super(l,r); + name="="; + } + + public boolean test() + { + if (right instanceof TestExpr) + { + return ((TestExpr)right).testValue(left.getValue()); + } + else + { + return left.getValue()==right.getValue(); + } + } +} + +class CompareNE extends CompareExpr +{ + public CompareNE(DiceExpression l,DiceExpression r) + { + super(l,r); + name="<>"; + } + + public boolean test() + { + if (right instanceof TestExpr) + { + return !((TestExpr)right).testValue(left.getValue()); + } + else + { + return left.getValue()!=right.getValue(); + } + } +} Added: trunk/src/openrpg2/common/dice/Const.java =================================================================== --- trunk/src/openrpg2/common/dice/Const.java (rev 0) +++ trunk/src/openrpg2/common/dice/Const.java 2013-09-18 23:07:11 UTC (rev 102) @@ -0,0 +1,88 @@ +/* + * ==================================================================== + * Copyright (C) 2005-2006 The OpenRPG Project (www.openrpg.com) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This software 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 General Public License on www.gnu.org for more details. + * ==================================================================== + */ + +package openrpg2.common.dice; + +/** + * + * @author markt + */ +public class Const implements UniValue, TestExpr +{ + private final int value; + + /** + * + * @return value of constant expression + */ + public int getValue() + { + return value; + } + + /** + * + * @return text form of constant expression + */ + public String getTextDetail() + { + return ""+value; + } + + /** + * + * @return text form of constant expression + */ + public String getText() + { + return ""+value; + } + + /** + * Placeholder for executing the expression (does nothing) + */ + public void exec() + { + } + + /** + * Constructor for constant expression + * @param n the integer this constant represents + */ + public Const(int n) + { + value=n; + } + + /** + * Test function to compare an integer with this expression + * @param n the integer to compare to + * @return true if they are the same, false otherwise + */ + public boolean testValue(int n) + { + return n==value; + } + + /** + * + * @return a negated constant expression + */ + public DiceExpression negate() + { + return new Const(-value); + } +} Added: trunk/src/openrpg2/common/dice/DiceExpression.java =================================================================== --- trunk/src/openrpg2/common/dice/DiceExpression.java (rev 0) +++ trunk/src/openrpg2/common/dice/DiceExpression.java 2013-09-18 23:07:11 UTC (rev 102) @@ -0,0 +1,49 @@ +/* + * ==================================================================== + * Copyright (C) 2005-2006 The OpenRPG Project (www.openrpg.com) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This software 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 General Public License on www.gnu.org for more details. + * ==================================================================== + */ + +package openrpg2.common.dice; + +/** + * + * @author markt + */ +public interface DiceExpression +{ + /** + * + * @return the integer value for this expression + */ + public int getValue(); + /** + * + * @return the negated form if this expression + */ + public DiceExpression negate(); + /** + * + * @return text form of this expression + */ + public String getText(); + /** + * + * @return text form of this expression, after executing + */ + public String getTextDetail(); + /** + * Executes this expression + */ + public void exec(); +} Added: trunk/src/openrpg2/common/dice/DiceParser.java =================================================================== --- trunk/src/openrpg2/common/dice/DiceParser.java (rev 0) +++ trunk/src/openrpg2/common/dice/DiceParser.java 2013-09-18 23:07:11 UTC (rev 102) @@ -0,0 +1,540 @@ +/* + * ==================================================================== + * Copyright (C) 2005-2006 The OpenRPG Project (www.openrpg.com) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This software 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 General Public License on www.gnu.org for more details. + * ==================================================================== + */ + +package openrpg2.common.dice; + +import java.io.StringReader; +import java.text.ParseException; +import java.util.HashMap; +import java.util.Map; + +/** + * Parses a numeric dice expression<br/> + * A dice expression is a mathematical expression that uses standard 'd' + * notation to represent a die with a given number of sides, and use that + * in an arithmetic expression, such as 3d8+1, which will roll 3 8-sided dice, + * and add 1 to the result.<br/> + * There are numerous functions and die roll modifiers that can be applied as + * well.<br/> + * For example, the dice expression <tt>highest(4d6,3)</tt> rolls 4 6-sided dice + * and takes the highest 3 for a result.<br/> + * Additionally, dice expressions can have modifers, for example + * <tt>5d6.reroll(1)</tt> would roll 5 6-sided dice rerolling 1's.<br/> + * Supported functions are as follows + * <ul> + * <li>highest(dice, n) takes the highest 'n' dice out of the ones in the dice + * expression.</li> + * <li>lowest(dice, n) takes the lowest 'n' dice out of the ones in the dice + * expression</li> + * <li>until(expr,test) keeps rerolling dice in the given expression until the + * value of the expression satisfies the test expression provided, which can be + * the word "even", "odd", "any", a single number, or a range of numbers + * specified as start..end (either the start or end value + * may optionally be omitted, in which case either would default to a minimum + * or maximum value, as appropriate</li> + * <li>max(expr,expr...) results in the maximum of the expressions passed into + * it.</li> + * <li>min(expr,expr...) results in the maximum of the expressions passed into + * it.</li> + * <li>count(dice) returns the number of dice rolled</li> + * </ul> + * Supported dice modifiers are as follows + * <ul> + * <li>min(value) specifies the minimum value for any given die. + * If the value rolled is less than this, the minimum is taken</li> + * <li>max(value) specifies the maximum value for any given die.</li> + * <li>reroll(test) causes dice values that satisfy test to be rerolled (see + * description of 'until' function above for an outline of what forms are + * suitable for test)</li> + * <li>ignore(test) causes dice values that satisfy test to be ignored.</li> + * <li>change(test,expr) causes dice values that satisfy test to be changed to + * the given expression</li> + * <li>more(test,expr) When a die roll satisfies the test case, add more dice to + * those being rolled. The number of dice to roll is given by the expression + * provided (and may itself be a dice expression)</li> + * </ul> + * @author markt + */ +public class DiceParser { + + static class CIString implements Comparable<CIString> + { + private String str; + + CIString(String s) + { + str=s; + } + + @Override + public String toString() + { + return str; + } + + @Override + public int hashCode() + { + return str.toUpperCase().hashCode(); + } + + @Override + public boolean equals(Object obj) + { + if (obj == null) + { + return false; + } + if (getClass() != obj.getClass()) + { + return false; + } + final CIString other = (CIString) obj; + if ((str == null) ? (other.str != null) : !str.equalsIgnoreCase(other.str)) + { + return false; + } + return true; + } + + public int compareTo(CIString o) + { + if (str==null && o.str==null) + { + return 0; + } + if (str==null) + { + return -1; + } + if (o==null) + { + return 1; + } + return str.compareToIgnoreCase(o.str); + } + + } + + static interface DieFunctionFactory { + public DieFunction create(); + } + + static interface FunctionFactory { + public Function create(); + } + + static Map<CIString,DieFunctionFactory> dieFunctions = new HashMap<CIString,DieFunctionFactory>(); + static Map<CIString,FunctionFactory> functions = new HashMap<CIString,FunctionFactory>(); + + static { + dieFunctions.put(new CIString("min"), new DieFunctionFactory() + { + public DieFunction create() + { + return new MinDieFunc(); + } + }); + dieFunctions.put(new CIString("max"), new DieFunctionFactory() + { + public DieFunction create() + { + return new MaxDieFunc(); + } + }); + dieFunctions.put(new CIString("reroll"), new DieFunctionFactory() + { + + public DieFunction create() + { + return new RerollDieFunc(); + } + }); + dieFunctions.put(new CIString("ignore"), new DieFunctionFactory() + { + public DieFunction create() + { + return new IgnoreDieFunc(); + } + }); + dieFunctions.put(new CIString("change"), new DieFunctionFactory() + { + public DieFunction create() + { + return new ChangeDieFunc(); + } + }); + dieFunctions.put(new CIString("more"), new DieFunctionFactory() + { + public DieFunction create() + { + return new MoreDieFunc(); + } + }); + + functions.put(new CIString("min"), new FunctionFactory() + { + public Function create() + { + return new MinFunc(); + } + }); + functions.put(new CIString("max"), new FunctionFactory() + { + public Function create() + { + return new MaxFunc(); + } + }); + functions.put(new CIString("highest"), new FunctionFactory() + { + public Function create() + { + return new HighestFunc(); + } + }); + functions.put(new CIString("lowest"), new FunctionFactory() + { + public Function create() + { + return new LowestFunc(); + } + }); + functions.put(new CIString("until"), new FunctionFactory() + { + public Function create() + { + return new UntilFunc(); + } + }); + functions.put(new CIString("dice"), new FunctionFactory() + { + public Function create() + { + return new DiceFunc(); + } + }); + } + + /** + * Gets a test expression + * @param scanner Scanner to read from + * @return a test expression + * @throws ParseException on error + */ + public static TestExpr getTest(Scanner scanner) throws ParseException + { + Object token = scanner.getToken(); + TestExpr test =null; + if (token==Scanner.TINTEGER) + { + int start; + start = scanner.getIntValue(); + scanner.scan(); + if (scanner.getToken()==Scanner.TDOTDOT) + { + scanner.scan(); + if(scanner.getToken()==Scanner.TINTEGER) + { + int end = scanner.getIntValue(); + scanner.scan(); + if ( end < start ) + { + throw new ParseException("Second value cannot be before first",scanner.getLastPosition()); + } + if ( end == start ) + { + test = new Const(start); + } + else + { + test = new RangeTest(start,end); + } + } + else + { + test = new RangeTest(start,Integer.MAX_VALUE); + } + } + else + { + test = new Const(start); + } + } + else if (token==Scanner.TDOTDOT) + { + scanner.scan(); + if(scanner.getToken()==Scanner.TINTEGER) + { + test=new RangeTest(Integer.MIN_VALUE,scanner.getIntValue()); + scanner.scan(); + } + else + { + test = new RangeTest(Integer.MIN_VALUE,Integer.MAX_VALUE); + } + } + else if (token==Scanner.TID) + { + if (scanner.getString().equalsIgnoreCase("any")) + { + test = new RangeTest(Integer.MIN_VALUE,Integer.MAX_VALUE); + scanner.scan(); + } + else if (scanner.getString().equalsIgnoreCase("even")) + { + test = new EvenTest(); + scanner.scan(); + } + else if (scanner.getString().equalsIgnoreCase("odd")) + { + test = new OddTest(); + scanner.scan(); + } + } + if ( test==null ) + { + throw new ParseException("Expected test value",scanner.getLastPosition()); + } + return test; + } + + /** + * Gets an expression + * @param scanner Scanner to read from + * @return the expression at the current position in the scanner + * @throws ParseException on error + */ + public static DiceExpression getExpression(Scanner scanner) throws ParseException + { + DiceExpression expr = null; + expr = getTerm(scanner); + if(scanner.getToken()==Scanner.TPLUS || scanner.getToken()==Scanner.TMINUS) + { + SumExpr result = new SumExpr(); + result.append(expr); + while(scanner.getToken()==Scanner.TPLUS || scanner.getToken()==Scanner.TMINUS) + { + if(scanner.getToken()==Scanner.TPLUS) + { + scanner.scan(); + } + result.append(getTerm(scanner)); + } + return result; + } + return expr; + } + + /** + * Gets a single term expression + * @param scanner Scanner to read from + * @return a single term expression from the scanner + * @throws ParseException on error + */ + public static DiceExpression getTerm(Scanner scanner) throws ParseException + { + DiceExpression expr = getFactor(scanner); + if(scanner.getToken()==Scanner.TSTAR || scanner.getToken()==Scanner.TSLASH) + { + ProdExpr result = new ProdExpr(); + result.appendNum(expr); + while(scanner.getToken()==Scanner.TSTAR || scanner.getToken()==Scanner.TSLASH) + { + if(scanner.getToken()==Scanner.TSTAR) + { + scanner.scan(); + result.appendNum(getFactor(scanner)); + } + else + { + scanner.scan(); + result.appendDen(getFactor(scanner)); + } + } + return result; + } + return expr; + } + + /** + * Gets a single factor + * @param scanner Scanner to read from + * @return a single factor from the scanner + * @throws ParseException on error + */ + public static DiceExpression getFactor(Scanner scanner) throws ParseException + { + DiceExpression result; + boolean negate = false; + while (scanner.getToken()==Scanner.TMINUS) + { + negate=!negate; + scanner.scan(); + } + result=getUnary(scanner); + if (negate) + { + result=result.negate(); + } + return result; + } + + /** + * Gets a unary expression from the scanner + * @param scanner the Scanner to read from + * @return the unary expression from the scanner + * @throws ParseException on error + */ + public static DiceExpression getUnary(Scanner scanner) throws ParseException + { + if (scanner.getToken()==Scanner.TLEFT) + { + DiceExpression result; + scanner.scan(); + result=getExpression(scanner); + if(scanner.getToken()!=Scanner.TRIGHT) + { + throw new ParseException("Expected ')'",scanner.getLastPosition()); + } + scanner.scan(); + return result; + } + else if (scanner.getToken()==Scanner.TDICE) + { + MultiDice result = new MultiDice(scanner.getIntValue(),scanner.getDiceValue()); + scanner.scan(); + while(scanner.getToken()==Scanner.TDOT) + { + scanner.scan(); + if(scanner.getToken()!=Scanner.TID) + { + throw new ParseException("Expected function name",scanner.getLastPosition()); + } + DieFunctionFactory factory = dieFunctions.get(new CIString(scanner.getString())); + if(factory==null) + { + throw new ParseException("Expected function name",scanner.getLastPosition()); + } + DieFunction diefunc = factory.create(); + scanner.scan(); + if (scanner.getToken()!=Scanner.TLEFT) + { + throw new ParseException("Expected '('",scanner.getLastPosition()); + + } + scanner.scan(); + boolean parse = diefunc.parse(scanner); + if (!parse) + { + throw new ParseException("Invalid Argument(s)",scanner.getLastPosition()); + } + if (scanner.getToken()!=Scanner.TRIGHT) + { + throw new ParseException("Expected ')'",scanner.getLastPosition()); + } + scanner.scan(); + result.addModifier(diefunc); + } + return result; + } + else if (scanner.getToken()==Scanner.TINTEGER) + { + Const result = new Const(scanner.getIntValue()); + scanner.scan(); + return result; + } + else if (scanner.getToken()==Scanner.TID) + { + FunctionFactory factory=functions.get(new CIString(scanner.getString())); + if(factory==null) + { + throw new ParseException("Expected function name",scanner.getLastPosition()); + } + Function result = factory.create(); + scanner.scan(); + if (scanner.getToken()!=Scanner.TLEFT) + { + throw new ParseException("Expected '('",scanner.getLastPosition()); + + } + scanner.scan(); + boolean parse = result.parse(scanner); + if (!parse) + { + throw new ParseException("Invalid Argument(s)",scanner.getLastPosition()); + } + if (scanner.getToken()!=Scanner.TRIGHT) + { + throw new ParseException("Expected ')'",scanner.getLastPosition()); + } + scanner.scan(); + return result; + } + else + { + throw new ParseException("Expected expression",scanner.getLastPosition()); + } + } + + /** + * Parses a string to retrieve a DiceExpression. + * @param s The string to parse + * @return a Dice Expression which represents what was in the string + * @throws ParseException + */ + public static DiceExpression parse(String s) throws ParseException + { + Scanner scanner=new Scanner(new StringReader(s)); + DiceExpression result=getExpression(scanner); + if ( scanner.getToken() != Scanner.TEOF ) + { + throw new ParseException("Unexpected characters at end of expression",scanner.getLastPosition()); + } + return result; + } + + /** + * Test function + * @param args + * @throws ParseException on error + */ + public static void main(String[] args) throws ParseException + { + String s="dice(until(3d8,3..18),until(3d8,3..18),until(3d8,3..18),until(3d8,3..18),until(3d8,3..18),until(3d8,3..18))"; + DiceExpression express=parse(s); + for(int i=0;i<100;i++) + { + express.exec(); + //System.out.print(express.getValue()+" "); + System.out.print('['); + int [] details=((MultiValue)express).getDetails(); + for(int j=0;j<details.length;j++) + { + if ( j != 0 ) + { + System.out.print(','); + } + if ( details[j] < 10 ) + { + System.out.print(' '); + } + System.out.print(details[j]); + } + System.out.println(']'); + } + } +} Added: trunk/src/openrpg2/common/dice/DieFunction.java =================================================================== --- trunk/src/openrpg2/common/dice/DieFunction.java (rev 0) +++ trunk/src/openrpg2/common/dice/DieFunction.java 2013-09-18 23:07:11 UTC (rev 102) @@ -0,0 +1,305 @@ +/* + * ==================================================================== + * Copyright (C) 2005-2006 The OpenRPG Project (www.openrpg.com) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This software 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 General Public License on www.gnu.org for more details. + * ==================================================================== + */ + +package openrpg2.common.dice; + +import java.text.ParseException; +import java.util.ArrayList; + + +/** + * + * @author markt + */ +public abstract class DieFunction +{ + private final String name; + /** + * Parameters for this dice function + */ + protected ArrayList<DiceExpression> params = new ArrayList<DiceExpression>(); + + /** + * Constructor for DieFunction + * @param n name of die function + */ + public DieFunction(String n) + { + name=n; + } + + /** + * + * @return text form of the die function, plus parameters + */ + public String getText() + { + StringBuilder result=new StringBuilder(); + result.append(name+"("); + boolean comma=false; + for(DiceExpression i:params) + { + if(comma) + { + result.append(','); + } + else + { + comma=true; + } + result.append(i.getText()); + } + result.append(')'); + return result.toString(); + } + + /** + * Executes the die function + */ + public void exec() + { + for(DiceExpression i:params) + { + i.exec(); + } + } + + /** + * Says what the new value of the currently rolled die should be + * @param orig original rolled value + * @param current rolled value + * @return new value + */ + public int getAlteredValue(int orig,int current) + { + return current; + } + + /** + * Tells how many more new dice should be rolled + * @param orig original rolled value + * @param current rolled value + * @return number of extra dice to roll + */ + public int getNewDice(int orig,int current) + { + return 0; + } + + /** + * DiceParser for the die function, parses each argument + * @param scanner Scanner being used to read input + * @return true if the function was parsed successfully, false otherwise + * @throws ParseException on error + */ + public abstract boolean parse(Scanner scanner) throws ParseException; +} +class RerollDieFunc extends DieFunction +{ + public RerollDieFunc() + { + super("reroll"); + } + + @Override + public int getAlteredValue(int orig,int current) + { + TestExpr test = (TestExpr) params.get(0); + if (test.testValue(current)) + { + return 0; + } + return current; + } + + @Override + public int getNewDice(int orig,int current) + { + TestExpr test = (TestExpr) params.get(0); + if (test.testValue(current)) + { + return 1; + } + return 0; + } + + @Override + public boolean parse(Scanner scanner) throws ParseException + { + params.add(DiceParser.getTest(scanner)); + return true; + } +} + +class MinDieFunc extends DieFunction +{ + public MinDieFunc() + { + super("min"); + } + + @Override + public boolean parse(Scanner scanner) throws ParseException + { + DiceExpression expr = DiceParser.getExpression(scanner); + if ( expr != null ) + { + params.add(expr); + return true; + } + return false; + } + + @Override + public int getAlteredValue(int orig,int current) + { + int test = params.get(0).getValue(); + if ( current < test ) + { + return test; + } + return current; + } +} + +class MaxDieFunc extends DieFunction +{ + public MaxDieFunc() + { + super("max"); + } + + @Override + public boolean parse(Scanner scanner) throws ParseException + { + DiceExpression expr = DiceParser.getExpression(scanner); + if ( expr != null ) + { + params.add(expr); + return true; + } + return false; + } + + @Override + public int getAlteredValue(int orig,int current) + { + int test = params.get(0).getValue(); + if ( current > test ) + { + return test; + } + return current; + } +} + +class IgnoreDieFunc extends DieFunction +{ + public IgnoreDieFunc() + { + super("ignore"); + } + + + @Override + public int getAlteredValue(int orig,int current) + { + TestExpr test = (TestExpr) params.get(0); + if (test.testValue(current)) + { + return 0; + } + return current; + } + + @Override + public boolean parse(Scanner scanner) throws ParseException + { + params.add(DiceParser.getTest(scanner)); + return true; + } + +} + +class ChangeDieFunc extends DieFunction +{ + + public ChangeDieFunc() + { + super("change"); + } + + @Override + public int getAlteredValue(int orig,int current) + { + TestExpr test = (TestExpr) params.get(0); + if (test.testValue(current)) + { + params.get(1).exec(); + return params.get(1).getValue(); + } + return current; + } + + @Override + public boolean parse(Scanner scanner) throws ParseException + { + params.add(DiceParser.getTest(scanner)); + if ( scanner.getToken()!=Scanner.TCOMMA ) + { + throw new ParseException("Expected ','",scanner.getLastPosition()); + } + scanner.scan(); + params.add(DiceParser.getExpression(scanner)); + return true; + } + +} + +class MoreDieFunc extends DieFunction +{ + + public MoreDieFunc() + { + super("more"); + } + + @Override + public int getNewDice(int orig,int current) + { + TestExpr test = (TestExpr) params.get(0); + if (test.testValue(current)) + { + params.get(1).exec(); + return params.get(1).getValue(); + } + return 0; + } + + @Override + public boolean parse(Scanner scanner) throws ParseException + { + params.add(DiceParser.getTest(scanner)); + if ( scanner.getToken()!=Scanner.TCOMMA ) + { + throw new ParseException("Expected ','",scanner.getLastPosition()); + } + scanner.scan(); + params.add(DiceParser.getExpression(scanner)); + return true; + } + +} \ No newline at end of file Added: trunk/src/openrpg2/common/dice/Function.java =================================================================== --- trunk/src/openrpg2/common/dice/Function.java (rev 0) +++ trunk/src/openrpg2/common/dice/Function.java 2013-09-18 23:07:11 UTC (rev 102) @@ -0,0 +1,145 @@ +/* + * ==================================================================== + * Copyright (C) 2005-2006 The OpenRPG Project (www.openrpg.com) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This software 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 General Public License on www.gnu.org for more details. + * ==================================================================== + */ + +package openrpg2.common.dice; + +import java.text.ParseException; +import java.util.ArrayList; + +/** + * + * @author markt + */ +public abstract class Function implements DiceExpression { + /** + * parameters for the function + */ + protected ArrayList<DiceExpression> params=new ArrayList<DiceExpression>(); + + private final String name; + + /** + * Gets the text detail for one of the paremeters of the function + * @param index which parameter to examine + * @return the text detail for the index'th parameter to the function + */ + public String getParameterTextDetail(int index) + { + return params.get(index).getTextDetail(); + + } + /** + * + * @return text form of this expression (after executing) + */ + public String getTextDetail() + { + StringBuilder result=new StringBuilder(); + result.append(name+"("); + for(int i=0; i< params.size();i++) + { + if (i!=0) + result.append(","); + result.append(getParameterTextDetail(i)); + } + result.append(")"); + if ( this instanceof UniValue ) + { + result.append("->("+this.getValue()+")"); + } + else if ( this instanceof MultiValue ) + { + MultiValue val=(MultiValue)this; + result.append("->["); + for(int i=0;i<val.getDetails().length;i++) + { + if ( i > 0 ) + { + result.append(','); + } + result.append(val.getDetails()[i]); + } + result.append("]"); + } + return result.toString(); + } + + /** + * + * @return text form of this expression + */ + public String getText() + { + StringBuilder result=new StringBuilder(); + result.append(name+"("); + boolean comma=false; + for(DiceExpression i:params) + { + if(comma) + { + result.append(","); + } + else + { + comma=true; + } + result.append(i.getText()); + } + result.append(")"); + return result.toString(); + } + + /** + * executes the function + */ + public void exec() + { + for(DiceExpression i:params) + { + i.exec(); + } + run(); + } + + /** + * Function constructor + * @param n name of the function + */ + public Function(String n) + { + name=n; + } + + public DiceExpression negate() + { + return new NegExpr(this); + } + + /** + * Parses the function + * @param scanner Scanner that is reading the input + * @return true if the function has been parsed, false otherwise + * @throws ParseException on error + */ + public abstract boolean parse(Scanner scanner) throws ParseException; + + /** + * Executes the function after the parameters have been processed + */ + public abstract void run(); +} + + Added: trunk/src/openrpg2/common/dice/MultiDice.java =================================================================== --- trunk/src/openrpg2/common/dice/MultiDice.java (rev 0) +++ trunk/src/openrpg2/common/dice/MultiDice.java 2013-09-18 23:07:11 UTC (rev 102) @@ -0,0 +1,159 @@ +/* + * ==================================================================== + * Copyright (C) 2005-2006 The OpenRPG Project (www.openrpg.com) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This software 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 General Public License on www.gnu.org for more details. + * ==================================================================== + */ + +package openrpg2.common.dice; + +import java.util.ArrayList; +import java.util.Random; + +/** + * + * @author markt + */ +public class MultiDice implements DiceExpression, MultiValue { + private final static Random random = new Random(); + private final int sides; + private final int count; + private int[] details; + private final ArrayList<DieFunction> modifiers = new ArrayList<DieFunction>(); + + public int getValue() + { + int result=0; + for(int i=0;i<details.length;i++ ) + { + result+=details[i]; + } + if ( count < 0 ) + { + result=-result; + } + return result; + } + + public int[] getDetails() + { + return details; + } + + /** + * Executes this expression + */ + public void exec() + { + ArrayList<Integer> list = new ArrayList<Integer>(); + for(int i=0;i<Math.abs(count);i++ ) + { + int c = random.nextInt(sides)+1; + int old=c; + for(DieFunction j:modifiers) + { + j.exec(); + i-=j.getNewDice(old,c); + c=j.getAlteredValue(old,c); + if(c==0) + { + break; + } + } + if (c!=0) + { + list.add(new Integer(c)); + } + } + details=new int[list.size()]; + for(int i=0;i<details.length;i++) + { + details[i]=list.get(i).intValue(); + } + } + + /** + * Constructor for the multidice expression + * @param n number of dice to roll + * @param s number of sides for the dice + */ + public MultiDice(int n,int s) + { + count=n; + sides=s; + details = new int[0]; + } + + /** + * + * @return text form of the expression + */ + public String getText() + { + StringBuilder result=new StringBuilder(); + if (count<0) + { + result.append('-'); + } + if ( Math.abs(count) != 1 ) + { + result.append(Math.abs(count)); + } + result.append('d'); + result.append(sides); + for(DieFunction j:modifiers) + { + result.append("."); + result.append(j.getText()); + } + return result.toString(); + } + + /** + * + * @return detailed text form of the expression + */ + public String getTextDetail() + { + StringBuilder result=new StringBuilder(); + if (count<0) + { + result.append('-'); + } + result.append("["); + if (details.length>0) + { + result.append(details[0]); + } + for(int i=1;i<details.length;i++) + { + result.append(","); + result.append(details[i]); + } + result.append("]"); + return result.toString(); + } + + /** + * Adds a die function into this expression + * @param m DieFunction to add into the expression + */ + public void addModifier(DieFunction m) + { + modifiers.add(m); + } + + public DiceExpression negate() + { + return new NegExpr(this); + } +} Added: trunk/src/openrpg2/common/dice/MultiValue.java =================================================================== --- trunk/src/openrpg2/common/dice/MultiValue.java (rev 0) +++ trunk/src/openrpg2/common/dice/MultiValue.java 2013-09-18 23:07:11 UTC (rev 102) @@ -0,0 +1,30 @@ +/* + * ==================================================================== + * Copyright (C) 2005-2006 The OpenRPG Project (www.openrpg.com) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This software 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 General Public License on www.gnu.org for more details. + * ==================================================================== + */ + +package openrpg2.common.dice; + +/** + * + * @author markt + */ +public interface MultiValue +{ + /** + * + * @return the values that this represents + */ + public int[] getDetails(); +} Added: trunk/src/openrpg2/common/dice/MultiValueFunction.java =================================================================== --- trunk/src/openrpg2/common/dice/MultiValueFunction.java (rev 0) +++ trunk/src/openrpg2/common/dice/MultiValueFunction.java 2013-09-18 23:07:11 UTC (rev 102) @@ -0,0 +1,362 @@ +/* + * ==================================================================== + * Copyright (C) 2005-2006 The OpenRPG Project (www.openrpg.com) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This software 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 General Public License on www.gnu.org for more details. + * ==================================================================== + */ + +package openrpg2.common.dice; + +import java.text.ParseException; +import java.util.Arrays; + + +/** + * + * @author markt + */ +public abstract class MultiValueFunction extends Function implements MultiValue +{ + public int getValue() + { + int[] array=getDetails(); + int result=0; + for(int i=0;i<array.length;i++) + { + result+=array[i]; + } + return result; + } + + MultiValueFunction(String name) + { + super(name); + } +} +class DiceFunc extends MultiValueFunction +{ + public DiceFunc() + { + super("dice"); + } + + @Override + public boolean parse(Scanner scanner) throws ParseException + { + params.add(DiceParser.getExpression(scanner)); + while(scanner.getToken()==Scanner.TCOMMA) + { + scanner.scan(); + params.add(DiceParser.getExpression(scanner)); + } + return true; + } + + @Override + public void run() + { + } + + public int[] getDetails() + { + int [] result=new int[params.size()]; + for(int i=0;i<result.length;i++) + { + result[i]=params.get(i).getValue(); + } + return result; + } + + @Override + public String getTextDetail() + { + StringBuilder result=new StringBuilder(); + result.append(']'); + boolean comma=false; + for(DiceExpression i:params) + { + if(comma) + { + result.append(","); + } + else + { + comma=true; + } + result.append(i.getTextDetail()); + } + result.append(']'); + return result.toString(); + } +} + +class HighestFunc extends MultiValueFunction +{ + MultiValue param; + int [] details = new int[0]; + HighestFunc() + { + super("highest"); + } + + public int[] getDetails() + { + return details; + } + + @Override + public boolean parse(Scanner scanner) throws ParseException + { + DiceExpression first = DiceParser.getExpression(scanner); + if(first instanceof MultiValue) + { + param = (MultiValue)first; + } + else + { + throw new ParseException("Not a compound value",scanner.getLastPosition()); + } + params.add(first); + if(scanner.getToken()!=Scanner.TCOMMA) + { + throw new ParseException("Expected ','",scanner.getLastPosition()); + } + scanner.scan(); + if(scanner.getToken()!=Scanner.TINTEGER) + { + throw new ParseException("Expected integer",scanner.getLastPosition()); + } + if(scanner.getIntValue()<0) + { + throw new ParseException("Cannot have < 0 dice",scanner.getLastPosition()); + } + params.add(new Const(scanner.getIntValue())); + scanner.scan(); + return true; + } + + @Override + public void run() + { + int[] detailsSrc = param.getDetails(); + int count = params.get(1).getValue(); + details = new int[Math.min( count, detailsSrc.length )]; + for(int i=0;i<details.length;i++) + { + details[i]=i; + } + int comp=0; + for(int k=0;k<details.length;k++) + { + if(detailsSrc[details[k]]<detailsSrc[details[comp]]) + { + comp=k; + } + } + for(int i=details.length;i<detailsSrc.length;i++) + { + if (detailsSrc[i]>detailsSrc[details[comp]]) + { + details[comp]=i; + for(int k=0;i<details.length;k++) + { + if(detailsSrc[details[k]]<detailsSrc[details[comp]]) + { + comp=k; + } + } + } + } + Arrays.sort(details); + for(int i=0;i<details.length;i++) + { + details[i]=detailsSrc[details[i]]; + } + } + +} + +class LowestFunc extends MultiValueFunction +{ + MultiValue param; + int [] details = new int[0]; + LowestFunc() + { + super("lowest"); + } + + public int[] getDetails() + { + return details; + } + + @Override + public boolean parse(Scanner scanner) throws ParseException + { + DiceExpression first = DiceParser.getExpression(scanner); + if(first instanceof MultiValue) + { + param = (MultiValue)first; + } + else + { + throw new ParseException("Not a compound value",scanner.getLastPosition()); + } + params.add(first); + if(scanner.getToken()!=Scanner.TCOMMA) + { + throw new ParseException("Expected ','",scanner.getLastPosition()); + } + scanner.scan(); + if(scanner.getToken()!=Scanner.TINTEGER) + { + throw new ParseException("Expected integer",scanner.getLastPosition()); + } + if(scanner.getIntValue()<0) + { + throw new ParseException("Cannot have < 0 dice",scanner.getLastPosition()); + } + params.add(new Const(scanner.getIntValue())); + scanner.scan(); + return true; + } + + @Override + public void run() + { + int[] detailsSrc = param.getDetails(); + int count = params.get(1).getValue(); + details = new int[Math.min( count, detailsSrc.length )]; + for(int i=0;i<details.length;i++) + { + details[i]=i; + } + int comp=0; + for(int k=0;k<details.length;k++) + { + if(detailsSrc[details[k]]>detailsSrc[details[comp]]) + { + comp=k; + } + } + for(int i=details.length;i<detailsSrc.length;i++) + { + if (detailsSrc[i]<detailsSrc[details[comp]]) + { + details[comp]=i; + for(int k=0;i<details.length;k++) + { + if(detailsSrc[details[k]]>detailsSrc[details[comp]]) + { + comp=k; + } + } + } + } + Arrays.sort(details); + for(int i=0;i<details.length;i++) + { + details[i]=detailsSrc[details[i]]; + } + } +} + +class UntilFunc extends MultiValueFunction +{ + private static final int[] empty = new int[0]; + boolean counting; + + public UntilFunc() + { + super("until"); + } + + public String getParameterTextDetail(int index) + { + if (index==1 && counting) + return "#" + super.getParameterTextDetail(index); + else + return super.getParameterTextDetail(index); + + } + + @Override + public boolean parse(Scanner scanner) throws ParseException + { + counting = false; + params.add(DiceParser.getExpression(scanner)); + if ( scanner.getToken()!=Scanner.TCOMMA ) + { + throw new ParseException("Expected ','",scanner.getLastPosition()); + } + scanner.scan(); + if (scanner.getToken()==Scanner.THATCH) + { + scanner.scan(); + counting = true; + } + params.add(DiceParser.getTest(scanner)); + return true; + } + + private int getTestValue(DiceExpression test) + { + if (counting) + { + if (test instanceof MultiValue) + { + return ((MultiValue)test).getDetails().length; + } + else + { + return 1; + } + } + else + { + return test.getValue(); + } + } + + @Override + public void exec() + { + do + { + params.get(0).exec(); + params.get(1).exec(); + } + while (!((TestExpr)params.get(1)).testValue(getTestValue(params.get(0)))); + run(); + } + + @Override + public void run() + { + } + + @Override + public int getValue() + { + return params.get(0).getValue(); + } + + public int[] getDetails() + { + if ( params.get(0) instanceof MultiValue ) + { + return ((MultiValue)params.get(0)).getDetails(); + } + return empty; + } + +} \ No newline at end of file Added: trunk/src/openrpg2/common/dice/NegExpr.java =================================================================== --- trunk/src/openrpg2/common/dice/NegExpr.java (rev 0) +++ trunk/src/openrpg2/common/dice/NegExpr.java 2013-09-18 23:07:11 UTC (rev 102) @@ -0,0 +1,73 @@ +/* + * ==================================================================== + * Copyright (C) 2005-2006 The OpenRPG Project (www.openrpg.com) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This software 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 General Public License on www.gnu.org for more details. + * ==================================================================== + */ + +package openrpg2.common.dice; + +/** + * + * @author markt + */ +public class NegExpr implements DiceExpression,UniValue { + private final DiceExpression base; + + public int getValue() + { + return -base.getValue(); + } + + public String getText() + { + if ( base instanceof SumExpr || base instanceof ProdExpr || base instanceof NegExpr ) + { + return "-("+base.getText()+")"; + } + else + { + return "-"+base.getText(); + } + } + + public String getTextDetail() + { + if ( base instanceof SumExpr || base instanceof ProdExpr || base instanceof NegExpr ) + { + return "-("+base.getTextDetail()+")"; + } + else + { + return "-"+base.getTextDetail(); + } + } + + public void exec() + { + base.exec(); + } + + /** + * Constructor for NegExpr + * @param e expression to negate + */ + public NegExpr(DiceExpression e) + { + base = e; + } + + public DiceExpression negate() + { + return base; + } +} Added: trunk/src/openrpg2/common/dice/ProdExpr.java =================================================================== --- trunk/src/openrpg2/common/dice/ProdExpr.java (rev 0) +++ trunk/src/openrpg2/common/dice/ProdExpr.java 2013-09-18 23:07:11 UTC (rev 102) @@ -0,0 +1,205 @@ +/* + * ==================================================================== + * Copyright (C) 2005-2006 The OpenRPG Project (www.openrpg.com) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This software 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 General Public License on www.gnu.org for more details. + * ==================================================================== + */ + +package openrpg2.common.dice; + +import java.util.ArrayList; + +/** + * + * @author markt + */ +public class ProdExpr implements DiceExpression,UniValue +{ + private ArrayList<DiceExpression> numerator = new ArrayList<DiceExpression>(); + private ArrayList<DiceExpression> denominator = new ArrayList<DiceExpression>(); + + public int getValue() + { + int result=1; + for(DiceExpression j:numerator) + { + result*=j.getValue(); + } + for(DiceExpression j:denominator) + { + result/=j.getValue(); + } + return result; + } + + public String getText() + { + StringBuilder result=new StringBuilder(); + boolean product=false; + for(DiceExpression j:numerator) + { + if (product) + { + result.append('*'); + } + else + { + product=true; + } + if (j instanceof SumExpr || j instanceof ProdExpr) + { + result.append('('); + result.append(j.getText()); + result.append(')'); + } + else + { + result.append(j.getText()); + } + } + if (denominator.size()>0) + { + result.append('/'); + if (denominator.size()>1) + { + result.append('('); + } + for(DiceExpression j:denominator) + { + if (product) + { + result.append('*'); + } + else + { + product=true; + } + if (j instanceof SumExpr) + { + result.append('('); + result.append(j.getText()); + result.append(')'); + } + else + { + result.append(j.getText()); + } + } + if (denominator.size()>1) + { + result.append(')'); + } + } + return result.toString(); + } + + public String getTextDetail() + { + StringBuilder result=new StringBuilder(); + boolean product=false; + for(DiceExpression j:numerator) + { + if (product) + { + result.append('*'); + } + else + { + ... [truncated message content] |
From: Snowdog <sn...@ga...> - 2013-09-18 21:26:02
|
I've double checked the sf admin pages for the SVN tool permissions and the 'Developer (ORPG2)' group [that your a member of] is set to have write (commit) access to the svn. Most of the hits for that error on google seem to revolve around a case issue (the repository/path is case sensitive), so check your settings on that. It should be all lower case. Looks like some of the SVN apps (ex. TortoiseSVN) are prone to this. Let me know if you still can't get it sorted out. On Sep 17, 2013, at 4:46 PM, Mark Tarrabain <ma...@ly...> wrote: > Nope... it's giving me a 'access to /p/openrpg/svn/!svn/me' forbidden > message. > > Mark > > On 09/17/2013 09:11 AM, Snowdog wrote: >> Try now. Looks like when sf rolled to its current system some of the permissions got reset. >> You should have access for write now. >> --Snowdog >> >> On Sep 16, 2013, at 10:54 PM, Mark Tarrabain <ma...@ly...> wrote: >> >>> Hmmm.... I don't seem to have write-access to the svn repo anymore. >>> >>> Thoughts? >>> >>> Mark >>> >> >> >> >> >> >> ------------------------------------------------------------------------------ >> LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99! >> 1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint >> 2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes >> Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13. >> http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk >> _______________________________________________ >> Openrpg-v2-dev mailing list >> Ope...@li... >> https://lists.sourceforge.net/lists/listinfo/openrpg-v2-dev >> >> > > > ------------------------------------------------------------------------------ > LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99! > 1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint > 2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes > Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13. > http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk > _______________________________________________ > Openrpg-v2-dev mailing list > Ope...@li... > https://lists.sourceforge.net/lists/listinfo/openrpg-v2-dev --Snowdog |
From: Mark T. <ma...@ly...> - 2013-09-17 23:47:10
|
Nope... it's giving me a 'access to /p/openrpg/svn/!svn/me' forbidden message. Mark On 09/17/2013 09:11 AM, Snowdog wrote: > Try now. Looks like when sf rolled to its current system some of the permissions got reset. > You should have access for write now. > --Snowdog > > On Sep 16, 2013, at 10:54 PM, Mark Tarrabain <ma...@ly...> wrote: > >> Hmmm.... I don't seem to have write-access to the svn repo anymore. >> >> Thoughts? >> >> Mark >> > > > > > > ------------------------------------------------------------------------------ > LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99! > 1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint > 2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes > Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13. > http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk > _______________________________________________ > Openrpg-v2-dev mailing list > Ope...@li... > https://lists.sourceforge.net/lists/listinfo/openrpg-v2-dev > > |
From: Snowdog <sn...@ga...> - 2013-09-17 16:11:44
|
Try now. Looks like when sf rolled to its current system some of the permissions got reset. You should have access for write now. --Snowdog On Sep 16, 2013, at 10:54 PM, Mark Tarrabain <ma...@ly...> wrote: > Hmmm.... I don't seem to have write-access to the svn repo anymore. > > Thoughts? > > Mark > |
From: Mark T. <ma...@ly...> - 2013-09-17 06:10:02
|
Hmmm.... I don't seem to have write-access to the svn repo anymore. Thoughts? Mark On 09/16/2013 09:36 AM, Snowdog wrote: > Damn, caught with my hand in the cookie jar again. ;) > > Hey Mark, I thought everyone had given up on this list long ago. > > Go ahead and tear out the old dice roller code and replace it with your new stuff. > It won't interfere with any of my core coding I've been doing (being as there is no chat code yet) > > As for generics, yeah I've already been using them in the new code I've done recently. > Figured at this point, Java 1.7 is the new baseline for ORPG2. Most of the non-generic > collections have been depreciated in favor of the generics anyway. > > On Sep 13, 2013, at 10:37 PM, Mark Tarrabain <ma...@ly...> wrote: > >> Snowdog's been busy, it seems. >> >> Still, it's nice to see some activity here.... I've actually completely >> redesigned the dice roller that I wrote here since I was last working on >> this... learning from the mistakes I made with this one being far too >> generic, and as a result harder to use. The new one I came up with is >> actually more powerful, supporting things like adding variable numbers >> of dice to a die roll (ie. highest(3d6.more(5..6,1),3) would start by >> rolling a d6 and add 1 more die each time a 5 or 6 is rolled, and would >> finally take the highest 3 dice from that). >> >> Should I commit that? It's all within the openrpg2.common.dice package. >> >> Oh... one more thing... Can we use generics now? Or do we still have >> to use the pre-Java6 notation? >> >> Mark >> >> ------------------------------------------------------------------------------ >> LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99! >> 1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint >> 2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes >> Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/22/13. >> http://pubads.g.doubleclick.net/gampad/clk?id=64545871&iu=/4140/ostg.clktrk >> _______________________________________________ >> Openrpg-v2-dev mailing list >> Ope...@li... >> https://lists.sourceforge.net/lists/listinfo/openrpg-v2-dev > > > --Snowdog > > > > > > ------------------------------------------------------------------------------ > LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99! > 1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint > 2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes > Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13. > http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk > _______________________________________________ > Openrpg-v2-dev mailing list > Ope...@li... > https://lists.sourceforge.net/lists/listinfo/openrpg-v2-dev > > |
From: <sno...@us...> - 2013-09-17 00:06:36
|
Revision: 101 http://sourceforge.net/p/openrpg/svn/101 Author: snowdog_ Date: 2013-09-17 00:06:30 +0000 (Tue, 17 Sep 2013) Log Message: ----------- Traced the startup issues to what appear to be stalling routing threads. Available pool of threads would empty and result in a NullPointer Exception in message sending code. Reworked RouteThreadPool to spawn more worker if required and reworked worker assignment method. Suspect actual bug to exist in either the RouteServiceThread or in the network layers handoff routines. Modified Paths: -------------- trunk/src/openrpg2/common/core/route/RouteThreadPool.java Modified: trunk/src/openrpg2/common/core/route/RouteThreadPool.java =================================================================== --- trunk/src/openrpg2/common/core/route/RouteThreadPool.java 2013-09-16 21:10:47 UTC (rev 100) +++ trunk/src/openrpg2/common/core/route/RouteThreadPool.java 2013-09-17 00:06:30 UTC (rev 101) @@ -25,6 +25,7 @@ import java.util.Iterator; import java.util.LinkedList; import java.util.List; +import java.util.logging.Level; import java.util.logging.Logger; import openrpg2.common.core.engine.NetworkedModuleLocator; import openrpg2.common.core.network.NetworkMessageRelay; @@ -41,6 +42,9 @@ private NetworkedModuleLocator moduleLocator; private NetworkMessageRelay messageRelay; private int nextId = 1; + private final static int MAX_THREADS = 10; + private final static int MAX_ASSIGNMENT_ATTEMPTS = 10; + private final static int ASSIGNMENT_DELAY = 100; private Logger log = Logger.getLogger(this.getClass().getName()); @@ -50,18 +54,14 @@ public RouteThreadPool(NetworkedModuleLocator locatorRef, NetworkMessageRelay msgRelay, int initialSize) { moduleLocator = locatorRef; messageRelay = msgRelay; + if( initialSize > RouteThreadPool.MAX_THREADS){ initialSize = RouteThreadPool.MAX_THREADS; } for(int i = 0; i < initialSize; i++){ - RouteServiceThread nst = spawnServiceThread(); - synchronized(idle){ - idle.add(nst); - } - synchronized(threadHandles){ - threadHandles.add(nst); - } + addServiceThreadToPool(); } - } + + protected void shutdownThreads(){ Iterator i = threadHandles.iterator(); while (i.hasNext()){ @@ -74,13 +74,28 @@ protected RouteServiceThread getServiceThread(){ RouteServiceThread nst = null; - synchronized(idle){ - if( idle.size() > 0){ - nst = (RouteServiceThread)idle.remove(0); - }else{ - //System.out.println("RouteThreadPool::getServiceThread() No threads available"); + int attempts = 0; + do{ + synchronized(idle){ + if( idle.size() > 0){ + nst = (RouteServiceThread)idle.remove(0); + } } - } + if( nst == null){ + attempts += 1; + //System.out.println("RouteThreadPool::getServiceThread() No threads available; try #"+attempts); + if(( attempts > RouteThreadPool.MAX_ASSIGNMENT_ATTEMPTS)&&(threadHandles.size() < RouteThreadPool.MAX_THREADS)){ + addServiceThreadToPool(); + } + if(( attempts > RouteThreadPool.MAX_ASSIGNMENT_ATTEMPTS)&&(threadHandles.size() >= RouteThreadPool.MAX_THREADS)){ + log.severe("ROUTING ERROR: No available routing threads!!"); + return null; + } + try { + Thread.sleep(RouteThreadPool.ASSIGNMENT_DELAY); //sleep while a routing threat frees up.... + } catch (InterruptedException ex) {} + } + }while( nst == null); return nst; } @@ -97,11 +112,20 @@ private RouteServiceThread spawnServiceThread(){ RouteServiceThread nst = new RouteServiceThread(this, this.messageRelay, this.moduleLocator, nextId); nst.setName("RouteThread-"+nextId); - log.finer("spawnServiceThread creating new thread ("+nst.getName()+")"); + log.finer("spawning new service thread ("+nst.getName()+")"); nextId++; nst.start(); return nst; } + private void addServiceThreadToPool(){ + RouteServiceThread nst = spawnServiceThread(); + synchronized(idle){ + idle.add(nst); + } + synchronized(threadHandles){ + threadHandles.add(nst); + } + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: mDuo13 <md...@ya...> - 2013-09-16 23:37:02
|
I'm definitely gonna sit on the sidelines for this one, as Java code just gives me headaches, but I am listening in at least. Personally my group has moved over to Roll20.net as a platform since it doesn't require installing stuff, but I'm still interested to see where ORPG2 goes at this point. Not gonna lie, I've always viewed it as the example of an over-engineered project that collapsed under its own weight. I'd love to see that story turn around. --mDuo13 On 09/16/13 16:07, Snowdog wrote: > Last I checked ORPG is still a viable gaming platform for a fair number of users. > Maybe not as big as it was back in 2005-ish but it's still got decent user base > (if you include the Traipse users in that number too). Kinda surprising to me. > > As far as 'hacking the code in very bad ways' (lol I like that btw) thats one of > the great things about this new design. As long as you limit development to the > 'module' level even really hacked up code shouldn't pose much of a threat to the > 'core' as I call it. Modules have no direct connections to any of the core features > and get all their data via messages, event listening, and 'action' requests to > other modules. > > The core code itself is kinda complex and convoluted, but the module stuff should be > pretty straight forward. In fact, I'm really interested to find out what others > think about it from a module-building perspective. So I'd actually like the feedback > if your up to it. > > > On Sep 16, 2013, at 3:46 PM, "THOMAS BALENO" <tb...@us...> wrote: > >> I figured you were pretty much doing it for yourself. I'm not even sure how >> big a user base openrpg even has at this point. I'm going to stay out of it >> because I know you are a much better coder than me and I'd only hack the code >> up in very bad ways and you would have to come along and fix anything I did. >> It is just good to see you coding again. >> >> Tom >> >> ------ Original Message ------ >> Received: Mon, 16 Sep 2013 02:39:59 PM EDT >> From: Snowdog <sn...@ga...> >> To: "Developer mailing list for OpenRPG 2 \(Java\)" >> <ope...@li...> >> Subject: Re: [Openrpg2 dev] Woah.... it's active again! >> >>> Hi Tom, been a long time! >>> >>> Never quite sat well with me that ORPG development just kinda fizzled, >> especially >>> considering how it fizzled. I recently pulled down the most recent versions >> of both >>> OpenRPG (1.8) and Traipse to see how much the 'new fork' had advanced over >> the original >>> thinking I might merge beneficial changes from Traipse back into OpenRPG. I >> scoured over >>> a couple dozen diffs of key files and was generally disappointed that most >> of the code >>> changes seem cosmetic or at least functionally identical [aside from the >> mercurial-based >>> auto-update code and a handful of minor tweaks]. Given the nice glitzy >> website Traipse is >>> currently sporting I had hoped that more actual development had been done. >>> C'est la vie (i.e. "Oh well"). >>> >>> That got me thinking about the ORPG2 java code I wrote again... figured if >> the project was >>> basically dead anyway I might as well put some wrench time in on my original >> java redesign >>> rather than squander it on trying to beat on that 'old nag' in python. >>> >>> I'll be honest with you guys, I'm kinda just working on this for myself more >> than anything >>> else. But it is open source of course, and I welcome the help. Guess that >> means I should >>> probably start some documentation too. >>> >>> --Snowdog >>> >>> On Sep 16, 2013, at 10:45 AM, THOMAS BALENO <tb...@us...> wrote: >>> >>>> Nice to see you guys picking it up again. I saw the changes going in to >> the >>>> repository. >>>> >>>> Tom >>>> >>>> ------ Original Message ------ >>>> Received: Mon, 16 Sep 2013 01:10:17 PM EDT >>>> From: Snowdog <sn...@ga...> >>>> To: "Developer mailing list for OpenRPG 2 \(Java\)" >>>> <ope...@li...> >>>> Subject: Re: [Openrpg2 dev] Woah.... it's active again! >>>> >>>>> Damn, caught with my hand in the cookie jar again. ;) >>>>> >>>>> Hey Mark, I thought everyone had given up on this list long ago. >>>>> >>>>> Go ahead and tear out the old dice roller code and replace it with your >> new >>>> stuff. >>>>> It won't interfere with any of my core coding I've been doing (being as >>>> there is no chat code yet) >>>>> As for generics, yeah I've already been using them in the new code I've >> done >>>> recently. >>>>> Figured at this point, Java 1.7 is the new baseline for ORPG2. Most of >> the >>>> non-generic >>>>> collections have been depreciated in favor of the generics anyway. >>>>> >>>>> On Sep 13, 2013, at 10:37 PM, Mark Tarrabain <ma...@ly...> wrote: >>>>> >>>>>> Snowdog's been busy, it seems. >>>>>> >>>>>> Still, it's nice to see some activity here.... I've actually completely >>>>>> redesigned the dice roller that I wrote here since I was last working on >>>>>> this... learning from the mistakes I made with this one being far too >>>>>> generic, and as a result harder to use. The new one I came up with is >>>>>> actually more powerful, supporting things like adding variable numbers >>>>>> of dice to a die roll (ie. highest(3d6.more(5..6,1),3) would start by >>>>>> rolling a d6 and add 1 more die each time a 5 or 6 is rolled, and would >>>>>> finally take the highest 3 dice from that). >>>>>> >>>>>> Should I commit that? It's all within the openrpg2.common.dice >> package. >>>>>> Oh... one more thing... Can we use generics now? Or do we still have >>>>>> to use the pre-Java6 notation? >>>>>> >>>>>> Mark >>>>>> >>>>>> >> ------------------------------------------------------------------------------ >>>>>> LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99! >>>>>> 1,500+ hours of tutorials including VisualStudio 2012, Windows 8, >>>> SharePoint >>>>>> 2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack >>>> includes >>>>>> Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/22/13. >>>>>> >> http://pubads.g.doubleclick.net/gampad/clk?id=64545871&iu=/4140/ostg.clktrk >>>>>> _______________________________________________ >>>>>> Openrpg-v2-dev mailing list >>>>>> Ope...@li... >>>>>> https://lists.sourceforge.net/lists/listinfo/openrpg-v2-dev >>>>> >>>>> --Snowdog >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >> ------------------------------------------------------------------------------ >>>>> LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99! >>>>> 1,500+ hours of tutorials including VisualStudio 2012, Windows 8, >>>> SharePoint >>>>> 2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack >>>> includes >>>>> Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13. >>>>> >> http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk >>>>> _______________________________________________ >>>>> Openrpg-v2-dev mailing list >>>>> Ope...@li... >>>>> https://lists.sourceforge.net/lists/listinfo/openrpg-v2-dev >>>> >>>> >>>> >> ------------------------------------------------------------------------------ >>>> LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99! >>>> 1,500+ hours of tutorials including VisualStudio 2012, Windows 8, >> SharePoint >>>> 2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack >> includes >>>> Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13. >>>> >> http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk >>>> _______________________________________________ >>>> Openrpg-v2-dev mailing list >>>> Ope...@li... >>>> https://lists.sourceforge.net/lists/listinfo/openrpg-v2-dev >>> >>> --Snowdog >>> >>> >>> >>> >>> >>> >> ------------------------------------------------------------------------------ >>> LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99! >>> 1,500+ hours of tutorials including VisualStudio 2012, Windows 8, >> SharePoint >>> 2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack >> includes >>> Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13. >>> http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk >>> _______________________________________________ >>> Openrpg-v2-dev mailing list >>> Ope...@li... >>> https://lists.sourceforge.net/lists/listinfo/openrpg-v2-dev >> >> >> ------------------------------------------------------------------------------ >> LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99! >> 1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint >> 2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes >> Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13. >> http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk >> _______________________________________________ >> Openrpg-v2-dev mailing list >> Ope...@li... >> https://lists.sourceforge.net/lists/listinfo/openrpg-v2-dev > > --Snowdog > > > > > > ------------------------------------------------------------------------------ > LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99! > 1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint > 2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes > Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13. > http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk > _______________________________________________ > Openrpg-v2-dev mailing list > Ope...@li... > https://lists.sourceforge.net/lists/listinfo/openrpg-v2-dev > |
From: Snowdog <sn...@ga...> - 2013-09-16 23:07:28
|
Last I checked ORPG is still a viable gaming platform for a fair number of users. Maybe not as big as it was back in 2005-ish but it's still got decent user base (if you include the Traipse users in that number too). Kinda surprising to me. As far as 'hacking the code in very bad ways' (lol I like that btw) thats one of the great things about this new design. As long as you limit development to the 'module' level even really hacked up code shouldn't pose much of a threat to the 'core' as I call it. Modules have no direct connections to any of the core features and get all their data via messages, event listening, and 'action' requests to other modules. The core code itself is kinda complex and convoluted, but the module stuff should be pretty straight forward. In fact, I'm really interested to find out what others think about it from a module-building perspective. So I'd actually like the feedback if your up to it. On Sep 16, 2013, at 3:46 PM, "THOMAS BALENO" <tb...@us...> wrote: > I figured you were pretty much doing it for yourself. I'm not even sure how > big a user base openrpg even has at this point. I'm going to stay out of it > because I know you are a much better coder than me and I'd only hack the code > up in very bad ways and you would have to come along and fix anything I did. > It is just good to see you coding again. > > Tom > > ------ Original Message ------ > Received: Mon, 16 Sep 2013 02:39:59 PM EDT > From: Snowdog <sn...@ga...> > To: "Developer mailing list for OpenRPG 2 \(Java\)" > <ope...@li...> > Subject: Re: [Openrpg2 dev] Woah.... it's active again! > >> Hi Tom, been a long time! >> >> Never quite sat well with me that ORPG development just kinda fizzled, > especially >> considering how it fizzled. I recently pulled down the most recent versions > of both >> OpenRPG (1.8) and Traipse to see how much the 'new fork' had advanced over > the original >> thinking I might merge beneficial changes from Traipse back into OpenRPG. I > scoured over >> a couple dozen diffs of key files and was generally disappointed that most > of the code >> changes seem cosmetic or at least functionally identical [aside from the > mercurial-based >> auto-update code and a handful of minor tweaks]. Given the nice glitzy > website Traipse is >> currently sporting I had hoped that more actual development had been done. >> C'est la vie (i.e. "Oh well"). >> >> That got me thinking about the ORPG2 java code I wrote again... figured if > the project was >> basically dead anyway I might as well put some wrench time in on my original > java redesign >> rather than squander it on trying to beat on that 'old nag' in python. >> >> I'll be honest with you guys, I'm kinda just working on this for myself more > than anything >> else. But it is open source of course, and I welcome the help. Guess that > means I should >> probably start some documentation too. >> >> --Snowdog >> >> On Sep 16, 2013, at 10:45 AM, THOMAS BALENO <tb...@us...> wrote: >> >>> Nice to see you guys picking it up again. I saw the changes going in to > the >>> repository. >>> >>> Tom >>> >>> ------ Original Message ------ >>> Received: Mon, 16 Sep 2013 01:10:17 PM EDT >>> From: Snowdog <sn...@ga...> >>> To: "Developer mailing list for OpenRPG 2 \(Java\)" >>> <ope...@li...> >>> Subject: Re: [Openrpg2 dev] Woah.... it's active again! >>> >>>> Damn, caught with my hand in the cookie jar again. ;) >>>> >>>> Hey Mark, I thought everyone had given up on this list long ago. >>>> >>>> Go ahead and tear out the old dice roller code and replace it with your > new >>> stuff. >>>> It won't interfere with any of my core coding I've been doing (being as >>> there is no chat code yet) >>>> >>>> As for generics, yeah I've already been using them in the new code I've > done >>> recently. >>>> Figured at this point, Java 1.7 is the new baseline for ORPG2. Most of > the >>> non-generic >>>> collections have been depreciated in favor of the generics anyway. >>>> >>>> On Sep 13, 2013, at 10:37 PM, Mark Tarrabain <ma...@ly...> wrote: >>>> >>>>> Snowdog's been busy, it seems. >>>>> >>>>> Still, it's nice to see some activity here.... I've actually completely > >>>>> redesigned the dice roller that I wrote here since I was last working on > >>>>> this... learning from the mistakes I made with this one being far too >>>>> generic, and as a result harder to use. The new one I came up with is > >>>>> actually more powerful, supporting things like adding variable numbers >>>>> of dice to a die roll (ie. highest(3d6.more(5..6,1),3) would start by >>>>> rolling a d6 and add 1 more die each time a 5 or 6 is rolled, and would > >>>>> finally take the highest 3 dice from that). >>>>> >>>>> Should I commit that? It's all within the openrpg2.common.dice > package. >>>>> >>>>> Oh... one more thing... Can we use generics now? Or do we still have >>>>> to use the pre-Java6 notation? >>>>> >>>>> Mark >>>>> >>>>> >>> > ------------------------------------------------------------------------------ >>>>> LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99! >>>>> 1,500+ hours of tutorials including VisualStudio 2012, Windows 8, >>> SharePoint >>>>> 2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack >>> includes >>>>> Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/22/13. >>>>> >>> > http://pubads.g.doubleclick.net/gampad/clk?id=64545871&iu=/4140/ostg.clktrk >>>>> _______________________________________________ >>>>> Openrpg-v2-dev mailing list >>>>> Ope...@li... >>>>> https://lists.sourceforge.net/lists/listinfo/openrpg-v2-dev >>>> >>>> >>>> --Snowdog >>>> >>>> >>>> >>>> >>>> >>>> >>> > ------------------------------------------------------------------------------ >>>> LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99! >>>> 1,500+ hours of tutorials including VisualStudio 2012, Windows 8, >>> SharePoint >>>> 2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack >>> includes >>>> Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13. >>>> > http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk >>>> _______________________________________________ >>>> Openrpg-v2-dev mailing list >>>> Ope...@li... >>>> https://lists.sourceforge.net/lists/listinfo/openrpg-v2-dev >>> >>> >>> >>> > ------------------------------------------------------------------------------ >>> LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99! >>> 1,500+ hours of tutorials including VisualStudio 2012, Windows 8, > SharePoint >>> 2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack > includes >>> Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13. >>> > http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk >>> _______________________________________________ >>> Openrpg-v2-dev mailing list >>> Ope...@li... >>> https://lists.sourceforge.net/lists/listinfo/openrpg-v2-dev >> >> >> --Snowdog >> >> >> >> >> >> > ------------------------------------------------------------------------------ >> LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99! >> 1,500+ hours of tutorials including VisualStudio 2012, Windows 8, > SharePoint >> 2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack > includes >> Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13. >> http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk >> _______________________________________________ >> Openrpg-v2-dev mailing list >> Ope...@li... >> https://lists.sourceforge.net/lists/listinfo/openrpg-v2-dev > > > > ------------------------------------------------------------------------------ > LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99! > 1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint > 2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes > Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13. > http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk > _______________________________________________ > Openrpg-v2-dev mailing list > Ope...@li... > https://lists.sourceforge.net/lists/listinfo/openrpg-v2-dev --Snowdog |
From: THOMAS B. <tb...@us...> - 2013-09-16 22:46:20
|
I figured you were pretty much doing it for yourself. I'm not even sure how big a user base openrpg even has at this point. I'm going to stay out of it because I know you are a much better coder than me and I'd only hack the code up in very bad ways and you would have to come along and fix anything I did. It is just good to see you coding again. Tom ------ Original Message ------ Received: Mon, 16 Sep 2013 02:39:59 PM EDT From: Snowdog <sn...@ga...> To: "Developer mailing list for OpenRPG 2 \(Java\)" <ope...@li...> Subject: Re: [Openrpg2 dev] Woah.... it's active again! > Hi Tom, been a long time! > > Never quite sat well with me that ORPG development just kinda fizzled, especially > considering how it fizzled. I recently pulled down the most recent versions of both > OpenRPG (1.8) and Traipse to see how much the 'new fork' had advanced over the original > thinking I might merge beneficial changes from Traipse back into OpenRPG. I scoured over > a couple dozen diffs of key files and was generally disappointed that most of the code > changes seem cosmetic or at least functionally identical [aside from the mercurial-based > auto-update code and a handful of minor tweaks]. Given the nice glitzy website Traipse is > currently sporting I had hoped that more actual development had been done. > C'est la vie (i.e. "Oh well"). > > That got me thinking about the ORPG2 java code I wrote again... figured if the project was > basically dead anyway I might as well put some wrench time in on my original java redesign > rather than squander it on trying to beat on that 'old nag' in python. > > I'll be honest with you guys, I'm kinda just working on this for myself more than anything > else. But it is open source of course, and I welcome the help. Guess that means I should > probably start some documentation too. > > --Snowdog > > On Sep 16, 2013, at 10:45 AM, THOMAS BALENO <tb...@us...> wrote: > > > Nice to see you guys picking it up again. I saw the changes going in to the > > repository. > > > > Tom > > > > ------ Original Message ------ > > Received: Mon, 16 Sep 2013 01:10:17 PM EDT > > From: Snowdog <sn...@ga...> > > To: "Developer mailing list for OpenRPG 2 \(Java\)" > > <ope...@li...> > > Subject: Re: [Openrpg2 dev] Woah.... it's active again! > > > >> Damn, caught with my hand in the cookie jar again. ;) > >> > >> Hey Mark, I thought everyone had given up on this list long ago. > >> > >> Go ahead and tear out the old dice roller code and replace it with your new > > stuff. > >> It won't interfere with any of my core coding I've been doing (being as > > there is no chat code yet) > >> > >> As for generics, yeah I've already been using them in the new code I've done > > recently. > >> Figured at this point, Java 1.7 is the new baseline for ORPG2. Most of the > > non-generic > >> collections have been depreciated in favor of the generics anyway. > >> > >> On Sep 13, 2013, at 10:37 PM, Mark Tarrabain <ma...@ly...> wrote: > >> > >>> Snowdog's been busy, it seems. > >>> > >>> Still, it's nice to see some activity here.... I've actually completely > >>> redesigned the dice roller that I wrote here since I was last working on > >>> this... learning from the mistakes I made with this one being far too > >>> generic, and as a result harder to use. The new one I came up with is > >>> actually more powerful, supporting things like adding variable numbers > >>> of dice to a die roll (ie. highest(3d6.more(5..6,1),3) would start by > >>> rolling a d6 and add 1 more die each time a 5 or 6 is rolled, and would > >>> finally take the highest 3 dice from that). > >>> > >>> Should I commit that? It's all within the openrpg2.common.dice package. > >>> > >>> Oh... one more thing... Can we use generics now? Or do we still have > >>> to use the pre-Java6 notation? > >>> > >>> Mark > >>> > >>> > > ------------------------------------------------------------------------------ > >>> LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99! > >>> 1,500+ hours of tutorials including VisualStudio 2012, Windows 8, > > SharePoint > >>> 2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack > > includes > >>> Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/22/13. > >>> > > http://pubads.g.doubleclick.net/gampad/clk?id=64545871&iu=/4140/ostg.clktrk > >>> _______________________________________________ > >>> Openrpg-v2-dev mailing list > >>> Ope...@li... > >>> https://lists.sourceforge.net/lists/listinfo/openrpg-v2-dev > >> > >> > >> --Snowdog > >> > >> > >> > >> > >> > >> > > ------------------------------------------------------------------------------ > >> LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99! > >> 1,500+ hours of tutorials including VisualStudio 2012, Windows 8, > > SharePoint > >> 2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack > > includes > >> Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13. > >> http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk > >> _______________________________________________ > >> Openrpg-v2-dev mailing list > >> Ope...@li... > >> https://lists.sourceforge.net/lists/listinfo/openrpg-v2-dev > > > > > > > > ------------------------------------------------------------------------------ > > LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99! > > 1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint > > 2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes > > Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13. > > http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk > > _______________________________________________ > > Openrpg-v2-dev mailing list > > Ope...@li... > > https://lists.sourceforge.net/lists/listinfo/openrpg-v2-dev > > > --Snowdog > > > > > > ------------------------------------------------------------------------------ > LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99! > 1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint > 2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes > Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13. > http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk > _______________________________________________ > Openrpg-v2-dev mailing list > Ope...@li... > https://lists.sourceforge.net/lists/listinfo/openrpg-v2-dev |
From: <sno...@us...> - 2013-09-16 21:10:50
|
Revision: 100 http://sourceforge.net/p/openrpg/svn/100 Author: snowdog_ Date: 2013-09-16 21:10:47 +0000 (Mon, 16 Sep 2013) Log Message: ----------- Changed default logging level to ALL to troubleshoot startup sync issue(s) Modified Paths: -------------- trunk/src/openrpg2/client/core/ORPGClient.java trunk/src/openrpg2/server/core/ORPGServer.java Modified: trunk/src/openrpg2/client/core/ORPGClient.java =================================================================== --- trunk/src/openrpg2/client/core/ORPGClient.java 2013-09-14 17:50:44 UTC (rev 99) +++ trunk/src/openrpg2/client/core/ORPGClient.java 2013-09-16 21:10:47 UTC (rev 100) @@ -20,6 +20,7 @@ package openrpg2.client.core; import java.util.HashMap; +import java.util.logging.Level; import javax.swing.JMenuItem; import openrpg2.common.core.SplashScreen; import openrpg2.common.core.logging.DevConsole; @@ -49,6 +50,7 @@ private void setUpLogging(){ devconsole = new DevConsole(); sysLogger = new SystemLogger(devconsole); + sysLogger.setLoggingLevel(Level.ALL); devconsole.setSystemLoggerCallback(sysLogger); devconsole.postSystemInfo(); devconsole.postUserInfo(); Modified: trunk/src/openrpg2/server/core/ORPGServer.java =================================================================== --- trunk/src/openrpg2/server/core/ORPGServer.java 2013-09-14 17:50:44 UTC (rev 99) +++ trunk/src/openrpg2/server/core/ORPGServer.java 2013-09-16 21:10:47 UTC (rev 100) @@ -21,6 +21,7 @@ package openrpg2.server.core; import java.util.HashMap; +import java.util.logging.Level; import openrpg2.common.core.logging.DevConsole; import openrpg2.common.core.ORPGConstants; import openrpg2.common.core.engine.Engine; @@ -39,6 +40,7 @@ public ORPGServer(HashMap argmap) { DevConsole d = new DevConsole(); SystemLogger sysLogger = new SystemLogger(d); + sysLogger.setLoggingLevel(Level.ALL); new LogLevelSetter(argmap, sysLogger); //@TODO ignored new object is intentional?! look into this. d.setSystemLoggerCallback(sysLogger); //allows for log level checking in DevConsole This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: Snowdog <sn...@ga...> - 2013-09-16 18:39:36
|
Hi Tom, been a long time! Never quite sat well with me that ORPG development just kinda fizzled, especially considering how it fizzled. I recently pulled down the most recent versions of both OpenRPG (1.8) and Traipse to see how much the 'new fork' had advanced over the original thinking I might merge beneficial changes from Traipse back into OpenRPG. I scoured over a couple dozen diffs of key files and was generally disappointed that most of the code changes seem cosmetic or at least functionally identical [aside from the mercurial-based auto-update code and a handful of minor tweaks]. Given the nice glitzy website Traipse is currently sporting I had hoped that more actual development had been done. C'est la vie (i.e. "Oh well"). That got me thinking about the ORPG2 java code I wrote again... figured if the project was basically dead anyway I might as well put some wrench time in on my original java redesign rather than squander it on trying to beat on that 'old nag' in python. I'll be honest with you guys, I'm kinda just working on this for myself more than anything else. But it is open source of course, and I welcome the help. Guess that means I should probably start some documentation too. --Snowdog On Sep 16, 2013, at 10:45 AM, THOMAS BALENO <tb...@us...> wrote: > Nice to see you guys picking it up again. I saw the changes going in to the > repository. > > Tom > > ------ Original Message ------ > Received: Mon, 16 Sep 2013 01:10:17 PM EDT > From: Snowdog <sn...@ga...> > To: "Developer mailing list for OpenRPG 2 \(Java\)" > <ope...@li...> > Subject: Re: [Openrpg2 dev] Woah.... it's active again! > >> Damn, caught with my hand in the cookie jar again. ;) >> >> Hey Mark, I thought everyone had given up on this list long ago. >> >> Go ahead and tear out the old dice roller code and replace it with your new > stuff. >> It won't interfere with any of my core coding I've been doing (being as > there is no chat code yet) >> >> As for generics, yeah I've already been using them in the new code I've done > recently. >> Figured at this point, Java 1.7 is the new baseline for ORPG2. Most of the > non-generic >> collections have been depreciated in favor of the generics anyway. >> >> On Sep 13, 2013, at 10:37 PM, Mark Tarrabain <ma...@ly...> wrote: >> >>> Snowdog's been busy, it seems. >>> >>> Still, it's nice to see some activity here.... I've actually completely >>> redesigned the dice roller that I wrote here since I was last working on >>> this... learning from the mistakes I made with this one being far too >>> generic, and as a result harder to use. The new one I came up with is >>> actually more powerful, supporting things like adding variable numbers >>> of dice to a die roll (ie. highest(3d6.more(5..6,1),3) would start by >>> rolling a d6 and add 1 more die each time a 5 or 6 is rolled, and would >>> finally take the highest 3 dice from that). >>> >>> Should I commit that? It's all within the openrpg2.common.dice package. >>> >>> Oh... one more thing... Can we use generics now? Or do we still have >>> to use the pre-Java6 notation? >>> >>> Mark >>> >>> > ------------------------------------------------------------------------------ >>> LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99! >>> 1,500+ hours of tutorials including VisualStudio 2012, Windows 8, > SharePoint >>> 2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack > includes >>> Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/22/13. >>> > http://pubads.g.doubleclick.net/gampad/clk?id=64545871&iu=/4140/ostg.clktrk >>> _______________________________________________ >>> Openrpg-v2-dev mailing list >>> Ope...@li... >>> https://lists.sourceforge.net/lists/listinfo/openrpg-v2-dev >> >> >> --Snowdog >> >> >> >> >> >> > ------------------------------------------------------------------------------ >> LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99! >> 1,500+ hours of tutorials including VisualStudio 2012, Windows 8, > SharePoint >> 2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack > includes >> Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13. >> http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk >> _______________________________________________ >> Openrpg-v2-dev mailing list >> Ope...@li... >> https://lists.sourceforge.net/lists/listinfo/openrpg-v2-dev > > > > ------------------------------------------------------------------------------ > LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99! > 1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint > 2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes > Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13. > http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk > _______________________________________________ > Openrpg-v2-dev mailing list > Ope...@li... > https://lists.sourceforge.net/lists/listinfo/openrpg-v2-dev --Snowdog |
From: THOMAS B. <tb...@us...> - 2013-09-16 17:45:43
|
Nice to see you guys picking it up again. I saw the changes going in to the repository. Tom ------ Original Message ------ Received: Mon, 16 Sep 2013 01:10:17 PM EDT From: Snowdog <sn...@ga...> To: "Developer mailing list for OpenRPG 2 \(Java\)" <ope...@li...> Subject: Re: [Openrpg2 dev] Woah.... it's active again! > Damn, caught with my hand in the cookie jar again. ;) > > Hey Mark, I thought everyone had given up on this list long ago. > > Go ahead and tear out the old dice roller code and replace it with your new stuff. > It won't interfere with any of my core coding I've been doing (being as there is no chat code yet) > > As for generics, yeah I've already been using them in the new code I've done recently. > Figured at this point, Java 1.7 is the new baseline for ORPG2. Most of the non-generic > collections have been depreciated in favor of the generics anyway. > > On Sep 13, 2013, at 10:37 PM, Mark Tarrabain <ma...@ly...> wrote: > > > Snowdog's been busy, it seems. > > > > Still, it's nice to see some activity here.... I've actually completely > > redesigned the dice roller that I wrote here since I was last working on > > this... learning from the mistakes I made with this one being far too > > generic, and as a result harder to use. The new one I came up with is > > actually more powerful, supporting things like adding variable numbers > > of dice to a die roll (ie. highest(3d6.more(5..6,1),3) would start by > > rolling a d6 and add 1 more die each time a 5 or 6 is rolled, and would > > finally take the highest 3 dice from that). > > > > Should I commit that? It's all within the openrpg2.common.dice package. > > > > Oh... one more thing... Can we use generics now? Or do we still have > > to use the pre-Java6 notation? > > > > Mark > > > > ------------------------------------------------------------------------------ > > LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99! > > 1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint > > 2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes > > Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/22/13. > > http://pubads.g.doubleclick.net/gampad/clk?id=64545871&iu=/4140/ostg.clktrk > > _______________________________________________ > > Openrpg-v2-dev mailing list > > Ope...@li... > > https://lists.sourceforge.net/lists/listinfo/openrpg-v2-dev > > > --Snowdog > > > > > > ------------------------------------------------------------------------------ > LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99! > 1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint > 2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes > Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13. > http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk > _______________________________________________ > Openrpg-v2-dev mailing list > Ope...@li... > https://lists.sourceforge.net/lists/listinfo/openrpg-v2-dev |