Server Help Forum Index Server Help
Community forums for Subgame, ASSS, and bots
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   StatisticsStatistics   RegisterRegister 
 ProfileProfile   Login to check your private messagesLogin to check your private messages   LoginLogin (SSL) 

Server Help | ASSS Wiki (0) | Shanky.com
<py> to java applet

 
Post new topic   Reply to topic Printable version
 View previous topic  Pearl Harbour game Post :: Post Calling javac from a Java program  View next topic  
Author Message
BDwinsAlt
Agurus's Posse


Age:33
Gender:Gender:Male
Joined: Jun 16 2003
Posts: 1145
Location: Alabama
Offline

PostPosted: Tue Mar 20, 2007 1:06 am    Post subject: <py> to java applet Reply to topic Reply with quote

Can someone please help me turn this client into a java applet. I have the server/client all written in python. I want the server to stay in python. I think the client is all you need to recreate the python client into a java applet.

I'm hopping for a text field with IP:Port and Password then the options:
1. Start ASSS
2. Shutdown ASSS
3. Restart ASSS

When 1 is selected it needs to send "1" to the server and so on.

If you need more details let me know.

Note: the only thing being sent to the server is the password, then it sends a valid or invaild login message, and then it sends back "1", '2", or "3"

Here is my client code:
Code: Show/Hide

#----------------------------------------
# Name:   asssclient.py
# Date:   March 18, 2006
# Author: BDwinsAlt
#----------------------------------------

import socket

print 'ASSS Admin 1.0 by BDwinsAlt'

HOST = "MyCoolZone.com"
PORT = 1337
password = ""   # define your password here if you don't want to type it in each time.

try:
    socket1 = socket.socket ( socket.AF_INET, socket.SOCK_STREAM )
    socket1.connect ( ( HOST, PORT ) )
    if password != "":
        socket1.send(password)
    else:
        socket1.send(raw_input("Password> "))
    print socket1.recv(128)
    socket1.send(raw_input("> "))
    socket1.close()

except:
    print 'Connection error. Please check the IP and Port. The server may be offline.'
    socket1.close()


Ignore the things you don't need for the GUI, like the predefined password.

Thanks icon_biggrin.gif

Edit: I did it by myself. Java client is done.
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website AIM Address Yahoo Messenger MSN Messenger
Animate Dreams
Gotta buy them all!
(Consumer whore)


Age:36
Gender:Gender:Male
Joined: May 01 2004
Posts: 821
Location: Middle Tennessee
Offline

PostPosted: Wed Mar 21, 2007 11:52 am    Post subject: Reply to topic Reply with quote

Where's the source to the server and Java client?
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website AIM Address MSN Messenger
BDwinsAlt
Agurus's Posse


Age:33
Gender:Gender:Male
Joined: Jun 16 2003
Posts: 1145
Location: Alabama
Offline

PostPosted: Wed Mar 21, 2007 5:56 pm    Post subject: Reply to topic Reply with quote

I'm not releasing it now. When I do I'll put it in the custom projects.
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website AIM Address Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Server Help Forum Index -> Non-Subspace Related Coding All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum
View online users | View Statistics | View Ignored List


Software by php BB © php BB Group
Server Load: 673 page(s) served in previous 5 minutes.

phpBB Created this page in 0.409150 seconds : 28 queries executed (93.1%): GZIP compression disabled