Codebase Cleanup - 2020-09-27 (#14472)

* Codebase Cleanup - 2020-09-27

* Endings

* Forgot meta

* Farie Tweaks
This commit is contained in:
AffectedArc07
2020-10-15 13:22:52 -04:00
committed by GitHub
parent 632d913e8b
commit f40a8163ff
48 changed files with 18 additions and 2040 deletions
-50
View File
@@ -1,50 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_project_file>
<FileVersion major="1" minor="6" />
<Project>
<Option title="DLLSocket" />
<Option pch_mode="2" />
<Option compiler="gcc" />
<Build>
<Target title="Debug">
<Option output="bin\Debug\DLLSocket" prefix_auto="1" extension_auto="1" />
<Option object_output="obj\Debug\" />
<Option type="3" />
<Option compiler="gcc" />
<Option createDefFile="1" />
<Option createStaticLib="1" />
<Compiler>
<Add option="-Wall" />
<Add option="-DBUILD_DLL" />
<Add option="-g" />
</Compiler>
<Linker>
<Add library="user32" />
</Linker>
</Target>
<Target title="Release">
<Option output="bin\Release\DLLSocket" prefix_auto="1" extension_auto="1" />
<Option object_output="obj\Release\" />
<Option type="3" />
<Option compiler="gcc" />
<Option createDefFile="1" />
<Option createStaticLib="1" />
<Compiler>
<Add option="-Wall" />
<Add option="-DBUILD_DLL" />
<Add option="-O2" />
</Compiler>
<Linker>
<Add option="-s" />
<Add library="user32" />
</Linker>
</Target>
</Build>
<Unit filename="main.cpp" />
<Unit filename="main.h" />
<Extensions>
<code_completion />
<debugger />
</Extensions>
</Project>
</CodeBlocks_project_file>
-1
View File
@@ -1 +0,0 @@
g++ -static -shared -O3 -fPIC main.cpp -o DLLSocket.so
-133
View File
@@ -1,133 +0,0 @@
// OS-specific networking includes
// -------------------------------
#ifdef __WIN32
#include <winsock2.h>
typedef int socklen_t;
#else
extern "C" {
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
#include <fcntl.h>
#include <stdlib.h>
#include <string.h>
}
typedef int SOCKET;
typedef sockaddr_in SOCKADDR_IN;
typedef sockaddr SOCKADDR;
#define SOCKET_ERROR -1
#endif
// Socket used for all communications
SOCKET sock;
// Address of the remote server
SOCKADDR_IN addr;
// Buffer used to return dynamic strings to the caller
#define BUFFER_SIZE 1024
char return_buffer[BUFFER_SIZE];
// exposed functions
// ------------------------------
const char* SUCCESS = "1\0"; // string representing success
#ifdef __WIN32
#define DLL_EXPORT __declspec(dllexport)
#else
#define DLL_EXPORT __attribute__ ((visibility ("default")))
#endif
// arg1: ip(in the xx.xx.xx.xx format)
// arg2: port(a short)
// return: NULL on failure, SUCCESS otherwise
extern "C" DLL_EXPORT const char* establish_connection(int n, char *v[])
{
// extract args
// ------------
if(n < 2) return 0;
const char* ip = v[0];
const char* port_s = v[1];
unsigned short port = atoi(port_s);
// set up network stuff
// --------------------
#ifdef __WIN32
WSADATA wsa;
WSAStartup(MAKEWORD(2,0),&wsa);
#endif
sock = socket(AF_INET,SOCK_DGRAM,0);
// make the socket non-blocking
// ----------------------------
#ifdef __WIN32
unsigned long iMode=1;
ioctlsocket(sock,FIONBIO,&iMode);
#else
fcntl(sock, F_SETFL, O_NONBLOCK);
#endif
// establish a connection to the server
// ------------------------------------
memset(&addr,0,sizeof(SOCKADDR_IN));
addr.sin_family=AF_INET;
addr.sin_port=htons(port);
// convert the string representation of the ip to a byte representation
addr.sin_addr.s_addr=inet_addr(ip);
return SUCCESS;
}
// arg1: string message to send
// return: NULL on failure, SUCCESS otherwise
extern "C" DLL_EXPORT const char* send_message(int n, char *v[])
{
// extract the args
if(n < 1) return 0;
const char* msg = v[0];
// send the message
int rc = sendto(sock,msg,strlen(msg),0,(SOCKADDR*)&addr,sizeof(SOCKADDR));
// check for errors
if (rc != -1) {
return SUCCESS;
}
else {
return 0;
}
}
// no args
// return: message if any received, NULL otherwise
extern "C" DLL_EXPORT const char* recv_message(int n, char *v[])
{
SOCKADDR_IN sender; // we will store the sender address here
socklen_t sender_byte_length = sizeof(sender);
// Try receiving messages until we receive one that's valid, or there are no more messages
while(1) {
int rc = recvfrom(sock, return_buffer, BUFFER_SIZE,0,(SOCKADDR*) &sender,&sender_byte_length);
if(rc > 0) {
// we could read something
if(sender.sin_addr.s_addr != addr.sin_addr.s_addr) {
continue; // not our connection, ignore and try again
} else {
return_buffer[rc] = 0; // 0-terminate the string
return return_buffer;
}
}
else {
break; // no more messages, stop trying to receive
}
}
return 0;
}
-51
View File
@@ -1,51 +0,0 @@
import subprocess
import socket
import urlparse
UDP_IP="127.0.0.1"
UDP_PORT=8019
sock = socket.socket( socket.AF_INET, # Internet
socket.SOCK_DGRAM ) # UDP
sock.bind( (UDP_IP,UDP_PORT) )
last_ticker_state = None
def handle_message(data, addr):
global last_ticker_state
params = urlparse.parse_qs(data)
print(data)
try:
if params["type"][0] == "log" and str(params["log"][0]) and str(params["message"][0]):
open(params["log"][0],"a+").write(params["message"][0]+"\n")
except IOError:
pass
except KeyError:
pass
try:
if params["type"][0] == "ticker_state" and str(params["message"][0]):
last_ticker_state = str(params["message"][0])
except KeyError:
pass
try:
if params["type"][0] == "startup" and last_ticker_state:
open("crashlog.txt","a+").write("Server exited, last ticker state was: "+last_ticker_state+"\n")
except KeyError:
pass
sock.settimeout(60*6) # 10 minute timeout
while True:
try:
data, addr = sock.recvfrom( 1024 ) # buffer size is 1024 bytes
handle_message(data,addr)
except socket.timeout:
# try to start the server again
print("Server timed out.. attempting restart.")
if last_ticker_state:
open("crashmsg.txt","a+").write("Server crashed, trying to reboot. last ticker state: "+last_ticker_state+"\n")
subprocess.call("killall -9 DreamDaemon")
subprocess.call("./start")
+1 -1
View File
@@ -1312,7 +1312,7 @@
},
/area/vox_station)
"dA" = (
/obj/vox/win_button,
/obj/machinery/vox_win_button,
/turf/unsimulated/floor{
tag = "icon-light_on";
icon_state = "light_on"
+1 -1
View File
@@ -109,7 +109,7 @@
},
/area/holodeck/source_wildlife)
"ay" = (
/obj/vox/win_button,
/obj/machinery/vox_win_button,
/turf/unsimulated/floor/vox{
icon_state = "light_on"
},
+3 -3
View File
@@ -287,17 +287,17 @@ GLOBAL_LIST_EMPTY(cortical_stacks) //Stacks for 'leave nobody behind' objective.
return ..()
/obj/vox/win_button
/obj/machinery/vox_win_button
name = "shoal contact computer"
desc = "Used to contact the Vox Shoal, generally to arrange for pickup."
icon = 'icons/obj/computer.dmi'
icon_state = "tcstation"
/obj/vox/win_button/New()
/obj/machinery/vox_win_button/New()
. = ..()
overlays += icon('icons/obj/computer.dmi', "syndie")
/obj/vox/win_button/attack_hand(mob/user)
/obj/machinery/vox_win_button/attack_hand(mob/user)
if(!GAMEMODE_IS_HEIST || (world.time < 10 MINUTES)) //has to be heist, and at least ten minutes into the round
to_chat(user, "<span class='warning'>\The [src] does not appear to have a connection.</span>")
return 0
@@ -24,27 +24,27 @@
src.on_floor = on_floor
src.window_checks = window_checks
/datum/stack_recipe/proc/post_build(var/obj/item/stack/S, var/obj/result)
/datum/stack_recipe/proc/post_build(obj/item/stack/S, obj/result)
return
/* Special Recipes */
/datum/stack_recipe/cable_restraints
/datum/stack_recipe/cable_restraints/post_build(var/obj/item/stack/S, var/obj/result)
/datum/stack_recipe/cable_restraints/post_build(obj/item/stack/S, obj/result)
if(istype(result, /obj/item/restraints/handcuffs/cable))
result.color = S.color
..()
/datum/stack_recipe/dangerous
/datum/stack_recipe/dangerous/post_build(/obj/item/stack/S, /obj/result)
/datum/stack_recipe/dangerous/post_build(obj/item/stack/S, obj/result)
var/turf/targ = get_turf(usr)
message_admins("[title] made by [key_name_admin(usr)](<A HREF='?_src_=holder;adminmoreinfo=\ref[usr]'>?</A>) in [get_area(usr)] [ADMIN_COORDJMP(targ)]!",0,1)
log_game("[title] made by [key_name_admin(usr)] at [get_area(usr)] [targ.x], [targ.y], [targ.z].")
..()
/datum/stack_recipe/rods
/datum/stack_recipe/rods/post_build(var/obj/item/stack/S, var/obj/result)
/datum/stack_recipe/rods/post_build(obj/item/stack/S, obj/result)
if(istype(result, /obj/item/stack/rods))
var/obj/item/stack/rods/R = result
R.update_icon()
@@ -1,67 +0,0 @@
/obj/item/firework
name = "fireworks"
icon = 'icons/obj/fireworks.dmi'
icon_state = "rocket_0"
var/litzor = 0
var/datum/effect_system/sparkle_spread/S
/obj/item/firework/attackby(obj/item/W,mob/user, params)
if(litzor)
return
if(is_hot(W))
for(var/mob/M in viewers(user))
to_chat(M, "[user] lits \the [src]")
litzor = 1
icon_state = "rocket_1"
S = new()
S.set_up(5,0,src.loc)
sleep(30)
if(ismob(src.loc) || isobj(src.loc))
S.attach(src.loc)
S.start()
qdel(src)
/obj/item/sparkler
name = "sparkler"
icon = 'icons/obj/fireworks.dmi'
icon_state = "sparkler_0"
var/litzor = 0
/obj/item/sparkler/attackby(obj/item/W,mob/user, params)
if(litzor)
return
if(is_hot(W))
for(var/mob/M in viewers(user))
to_chat(M, "[user] lits \the [src]")
litzor = 1
icon_state = "sparkler_1"
var/b = rand(5,9)
for(var/xy, xy<=b, xy++)
do_sparks(1, 0, loc)
sleep(10)
qdel(src)
// TODO: Refactor this into a proper locker or something
// Or just axe the system. This code is 7 years old
/obj/crate/fireworks
name = "Fireworks!"
/obj/crate/fireworks/New()
new /obj/item/sparkler(src)
new /obj/item/sparkler(src)
new /obj/item/sparkler(src)
new /obj/item/sparkler(src)
new /obj/item/sparkler(src)
new /obj/item/sparkler(src)
new /obj/item/sparkler(src)
new /obj/item/sparkler(src)
new /obj/item/firework(src)
new /obj/item/firework(src)
new /obj/item/firework(src)
new /obj/item/firework(src)
new /obj/item/firework(src)
new /obj/item/firework(src)
new /obj/item/firework(src)
new /obj/item/firework(src)
new /obj/item/firework(src)
new /obj/item/firework(src)
+1
View File
@@ -1,3 +1,4 @@
// TODO: Refactor these into spawners
/obj/random
name = "Random Object"
desc = "This item type is used to spawn random objects at round-start"
-537
View File
@@ -1,537 +0,0 @@
/************************
* Point Of Sale
*
* Takes cash or credit.
*************************/
/line_item
parent_type = /datum
var/name = ""
var/price = 0 // Per unit
var/units = 0
GLOBAL_VAR_INIT(current_pos_id, 1)
GLOBAL_VAR_INIT(pos_sales, 0)
#define RECEIPT_HEADER {"<html>
<head>
<style type="text/css">
html {
font-family: monospace;
}
table {
margin: auto;
margin-top: 1em;
border-collapse: collapse;
}
th, td {
padding: 1px;
margin: 0;
}
td,
tr.first th {
border-left: 1px solid #ccc;
}
tr.first th.first {
border-left: none;
}
tr.even td,
tr.even th {
background: #f0f0f0;
}
tr.calculated {
font-style: italic;
}
tr.calculated td {
border-top: 1px solid #000;
border-left: 1px solid #ccc;
background: #fefefe;
}
tr.total {
font-weight: bold
}
tr.total td {
border-top: 1px solid #000;
background: #dfdfdf;
}
</style>
</head>
<body>
"}
#define POS_HEADER {"<html>
<head>
<style type="text/css">
* {
font-family: sans-serif;
font-size: small;
}
table {
margin: auto;
margin-top: 1em;
border-collapse: collapse;
}
th, td {
padding: 1px;
margin: 0;
}
td,
tr.first th {
border-left: 1px solid #ccc;
}
tr.first th.first {
border-left: none;
}
tr.even td,
tr.even th {
background: #f0f0f0;
}
tr.calculated {
font-style: italic;
}
tr.calculated td {
border-top: 1px solid #000;
border-left: 1px solid #ccc;
background: #fefefe;
}
tr.total {
font-weight: bold
}
tr.total td {
border-top: 1px solid #000;
background: #dfdfdf;
}
</style>
</head>
<body>
"}
#define POS_TAX_RATE 0.10 // 10%
#define POS_SCREEN_LOGIN 0
#define POS_SCREEN_ORDER 1
#define POS_SCREEN_FINALIZE 2
#define POS_SCREEN_PRODUCTS 3
#define POS_SCREEN_IMPORT 4
#define POS_SCREEN_EXPORT 5
#define POS_SCREEN_SETTINGS 6
/obj/machinery/pos
icon = 'icons/obj/machines/pos.dmi'
icon_state = "pos"
density = 0
name = "point of sale"
desc = "Also known as a cash register, or, more commonly, \"robbery magnet\"."
var/id = 0
var/sales = 0
var/department
var/mob/logged_in
var/datum/money_account/linked_account
var/credits_held = 0
var/credits_needed = 0
var/list/products = list() // name = /line_item
var/list/line_items = list() // # = /line_item
var/screen=POS_SCREEN_LOGIN
/obj/machinery/pos/New()
..()
id = GLOB.current_pos_id++
if(department)
linked_account = GLOB.department_accounts[department]
else
linked_account = GLOB.station_account
update_icon()
/obj/machinery/pos/proc/AddToOrder(var/name, var/units)
if(!(name in products))
return 0
var/line_item/LI = products[name]
var/line_item/LIC = new
LIC.name=LI.name
LIC.price=LI.price
LIC.units=units
line_items.Add(LIC)
/obj/machinery/pos/proc/RemoveFromOrder(var/order_id)
line_items.Cut(order_id,order_id+1)
/obj/machinery/pos/proc/NewOrder()
line_items.Cut()
/obj/machinery/pos/proc/PrintReceipt(var/order_id)
var/receipt = {"[RECEIPT_HEADER]<div>POINT OF SALE #[id]<br />
Paying to: [linked_account.owner_name]<br />
Cashier: [logged_in]<br />"}
if(myArea)
receipt += myArea.name
receipt += "</div>"
receipt += {"<br />
<div>[station_time_timestamp()], [GLOB.current_date_string]</div>
<table>
<tr class=\"first\">
<th class=\"first\">Item</th>
<th>Amount</th>
<th>Unit Price</th>
<th>Line Total</th>
</tr>"}
var/subtotal=0
for(var/i=1;i<=line_items.len;i++)
var/line_item/LI = line_items[i]
var/linetotal=LI.units*LI.price
receipt += "<tr class=\"[(i%2)?"even":"odd"]\"><th>[LI.name]</th><td>[LI.units]</td><td>$[num2septext(LI.price)]</td><td>$[num2septext(linetotal)]</td></tr>"
subtotal += linetotal
var/taxes = POS_TAX_RATE*subtotal
receipt += {"
<tr class="calculated">
<th colspan="3">SUBTOTAL</th><td>$[num2septext(subtotal)]</td>
</tr>
<tr>
<th colspan="3">TAXES</th><td>$[num2septext(taxes)]</td>
</tr>"}
receipt += {"
<tr class="calculated total">
<th colspan="3">TOTAL</th><td>$[num2septext(taxes+subtotal)]</th>
</tr>"}
receipt += "</table></body></html>"
playsound(loc, 'sound/goonstation/machines/printer_thermal.ogg', 50, 1)
var/obj/item/paper/P = new(loc)
P.name="Receipt #[id]-[++sales]"
P.info=receipt
P = new(loc)
P.name="Receipt #[id]-[sales] (Cashier Copy)"
P.info=receipt
/obj/machinery/pos/proc/LoginScreen()
return "<center><b>Please swipe ID to log in.</b></center>"
/obj/machinery/pos/proc/OrderScreen()
var/receipt = {"<fieldset>
<legend>POS Info</legend>
POINT OF SALE #[id]<br />
Paying to: [linked_account.owner_name]<br />
Cashier: [logged_in]<br />"}
if(myArea)
receipt += myArea.name
receipt += "</fieldset>"
receipt += {"<fieldset><legend>Order Data</legend>
<form action="?src=[UID()]" method="get">
<input type="hidden" name="src" value="[UID()]" />
<table>
<tr class=\"first\">
<th class=\"first\">Item</th>
<th>Amount</th>
<th>Unit Price</th>
<th>Line Total</th>
<th>...</th>
</tr>"}
var/subtotal=0
if(line_items.len>0)
for(var/i=1;i<=line_items.len;i++)
var/line_item/LI = line_items[i]
var/linetotal=LI.units*LI.price
receipt += {"<tr class=\"[(i%2)?"even":"odd"]\">
<th>[LI.name]</th>
<td><a href="?src=[UID()];setunits=[i]">[LI.units]</a></td>
<td>$[num2septext(LI.price)]</td>
<td>$[num2septext(linetotal)]</td>
<td><a href="?src=[UID()];removefromorder=[i]" style="color:red;">&times;</a></td>
</tr>"}
subtotal += linetotal
var/taxes = POS_TAX_RATE*subtotal
var/presets = "<i>(No presets available)</i>"
if(products.len>0)
presets = {"<select name="preset">""}
for(var/pid in products)
var/line_item/product = products[pid]
presets += {"<option value="[pid]">[product.name]</option>"}
presets += "</select>"
receipt += {"
<tr>
<td class="first">[presets]</td>
<td><input type="textbox" name="units" value="1.0" /> units</td>
<td colspan="2"><input type="submit" name="act" value="Add to Order" /></td>
</tr>
<tr class="calculated">
<th colspan="3">SUBTOTAL</th><td>$[num2septext(subtotal)]</td>
</tr>
<tr>
<th colspan="3">TAXES</th><td>$[num2septext(taxes)]</td>
</tr>"}
receipt += {"
<tr class="calculated total">
<th colspan="3">TOTAL</th><td>$[num2septext(taxes+subtotal)]</th>
</tr>"}
receipt += {"</table>
<input type="submit" name="act" value="Finalize Sale" />
<input type="submit" name="act" value="Reset" />
</form>
</fieldset>"}
return receipt
/obj/machinery/pos/proc/ProductsScreen()
var/dat={"<fieldset><legend>Product List</legend>
<form action="?src=[UID()]" method="get">
<input type="hidden" name="src" value="[UID()]" />
<table>
<tr class=\"first\">
<th class=\"first\">Item</th>
<th>Unit Price</th>
<th># Sold</th>
<th>...</th>
</tr>"}
for(var/i in products)
var/line_item/LI = products[i]
dat += {"<tr class=\"[(i%2)?"even":"odd"]\">
<th><a href="?src=[UID()];setpname=[i]">[LI.name]</a></th>
<td><a href="?src=[UID()];setprice=[i]">$[num2septext(LI.price)]</a></td>
<td>[LI.units]</td>
<td><a href="?src=[UID()];rmproduct=[i]" style="color:red;">&times;</a></td>
</tr>"}
dat += {"</table>
<b>New Product:</b><br />
<label for="name">Name:</label> <input type="textbox" name="name" value=""/><br />
<label for="name">Price:</label> $<input type="textbox" name="price" value="0.00" /><br />
<input type="submit" name="act" value="Add Product" /><br />
<a href="?src=[UID()];screen=[POS_SCREEN_IMPORT]">Import</a> | <a href="?src=[UID()];screen=[POS_SCREEN_EXPORT]">Export</a>
</form>
</fieldset>"}
return dat
/obj/machinery/pos/proc/ExportScreen()
var/dat={"<fieldset><legend>Export Products as CSV</legend>
<textarea>"}
for(var/i in products)
var/line_item/LI = products[i]
dat += "[LI.name],[LI.price]\n"
dat += {"</textarea>
<a href="?src=[UID()];screen=[POS_SCREEN_PRODUCTS]">OK</a>
</fieldset>"}
return dat
/obj/machinery/pos/proc/ImportScreen()
var/dat={"<fieldset>
<legend>Import Products as CSV</legend>
<form action="?src=[UID()]" method="get">
<input type="hidden" name="src" value="[UID()]" />
<textarea name="csv"></textarea>
<p>Data must be in the form of a CSV, with no headers or quotation marks.</p>
<p>First column must be product names, second must be prices as an unformatted number (####.##)</p>
<p>Deviations from this format will result in your import being rejected.</p>
<input type="submit" name="act" value="Add Products" />
</form>
</fieldset>"}
return dat
/obj/machinery/pos/proc/FinalizeScreen()
return "<center><b>Waiting for Credit</b><br /><a href=\"?src=[UID()];act=Reset\">Cancel</a></center>"
/obj/machinery/pos/proc/SettingsScreen()
var/dat={"<form action="?src=[UID()]" method="get">
<input type="hidden" name="src" value="[UID()]" />
<fieldset>
<legend>Account Settings</legend>
<div>
<b>Payable Account:</b> <input type="textbox" name="payableto" value="[linked_account.account_number]" />
</div>
</fieldset>
<fieldset>
<legend>Locality Settings</legend>
<div>
<b>Tax Rate:</b> <input type="textbox" name="taxes" value="[POS_TAX_RATE*100]" disabled="disabled" />% (LOCKED)
</div>
</fieldset>
<input type="submit" name="act" value="Save Settings" />
</form>"}
return dat
/obj/machinery/pos/update_icon()
overlays = 0
if(stat & (NOPOWER|BROKEN)) return
if(logged_in)
overlays += "pos-working"
else
overlays += "pos-standby"
/obj/machinery/pos/attack_hand(var/mob/user)
user.set_machine(src)
var/logindata=""
if(logged_in)
logindata={"<a href="?src=[UID()];logout=1">[logged_in.name]</a>"}
var/dat = POS_HEADER + {"
<div class="navbar">
[station_time_timestamp()], [GLOB.current_date_string]<br />
[logindata]
<a href="?src=[UID()];screen=[POS_SCREEN_ORDER]">Order</a> |
<a href="?src=[UID()];screen=[POS_SCREEN_PRODUCTS]">Products</a> |
<a href="?src=[UID()];screen=[POS_SCREEN_SETTINGS]">Settings</a>
</div>"}
switch(screen)
if(POS_SCREEN_LOGIN) dat += LoginScreen()
if(POS_SCREEN_ORDER) dat += OrderScreen()
if(POS_SCREEN_FINALIZE) dat += FinalizeScreen()
if(POS_SCREEN_PRODUCTS) dat += ProductsScreen()
if(POS_SCREEN_EXPORT) dat += ExportScreen()
if(POS_SCREEN_IMPORT) dat += ImportScreen()
if(POS_SCREEN_SETTINGS) dat += SettingsScreen()
dat += "</body></html>"
// END AUTOFIX
user << browse(dat, "window=pos")
onclose(user, "pos")
return
/obj/machinery/pos/proc/say(var/text)
src.visible_message("[bicon(src)] <span class=\"notice\"><b>[name]</b> states, \"[text]\"</span>")
/obj/machinery/pos/Topic(var/href, var/list/href_list)
if(..(href,href_list)) return
if("logout" in href_list)
if(alert(src, "You sure you want to log out?", "Confirm", "Yes", "No")!="Yes") return
logged_in=null
screen=POS_SCREEN_LOGIN
update_icon()
src.attack_hand(usr)
return
if(usr != logged_in)
to_chat(usr, "<span class='warning'>[logged_in.name] is already logged in. You cannot use this machine until they log out.</span>")
return
if("act" in href_list)
switch(href_list["act"])
if("Reset")
NewOrder()
screen=POS_SCREEN_ORDER
if("Finalize Sale")
var/subtotal=0
if(line_items.len>0)
for(var/i=1;i<=line_items.len;i++)
var/line_item/LI = line_items[i]
subtotal += LI.units*LI.price
var/taxes = POS_TAX_RATE*subtotal
credits_needed=taxes+subtotal
say("Your total is $[num2septext(credits_needed)]. Please insert credit chips or swipe your ID.")
screen=POS_SCREEN_FINALIZE
if("Add Product")
var/line_item/LI = new
LI.name=sanitize(href_list["name"])
LI.price=text2num(href_list["price"])
products["[products.len+1]"]=LI
if("Add to Order")
AddToOrder(href_list["preset"],text2num(href_list["units"]))
if("Add Products")
for(var/list/line in splittext(href_list["csv"],"\n"))
var/list/cells = splittext(line,",")
if(cells.len<2)
to_chat(usr, "<span class='warning'>The CSV must have at least two columns: Product Name, followed by Price (as a number).</span>")
src.attack_hand(usr)
return
var/line_item/LI = new
LI.name=sanitize(cells[1])
LI.price=text2num(cells[2])
products["[products.len+1]"]=LI
if("Export Products")
screen=POS_SCREEN_EXPORT
if("Import Products")
screen=POS_SCREEN_IMPORT
if("Save Settings")
var/datum/money_account/new_linked_account = get_money_account(text2num(href_list["payableto"]),z)
if(!new_linked_account)
to_chat(usr, "<span class='warning'>Unable to link new account.</span>")
else
linked_account = new_linked_account
screen=POS_SCREEN_SETTINGS
else if("screen" in href_list)
screen=text2num(href_list["screen"])
else if("rmproduct" in href_list)
products.Remove(href_list["rmproduct"])
else if("removefromorder" in href_list)
RemoveFromOrder(text2num(href_list["removefromorder"]))
else if("setunits" in href_list)
var/lid = text2num(href_list["setunits"])
var/newunits = input(usr,"Enter the units sold.") as num
if(!newunits) return
var/line_item/LI = line_items[lid]
LI.units = newunits
line_items[lid]=LI
else if("setpname" in href_list)
var/newtext = sanitize(input(usr,"Enter the product's name."))
if(!newtext) return
var/pid = href_list["setpname"]
var/line_item/LI = products[pid]
LI.name = newtext
products[pid]=LI
else if("setprice" in href_list)
var/newprice = input(usr,"Enter the product's price.") as num
if(!newprice) return
var/pid = href_list["setprice"]
var/line_item/LI = products[pid]
LI.price = newprice
products[pid]=LI
src.attack_hand(usr)
/obj/machinery/pos/attackby(var/atom/movable/A, var/mob/user, params)
if(istype(A,/obj/item/card/id))
var/obj/item/card/id/I = A
if(!logged_in)
user.visible_message("<span class='notice'>The machine beeps, and logs you in</span>","You hear a beep.")
logged_in = user
screen=POS_SCREEN_ORDER
update_icon()
src.attack_hand(user) //why'd you use usr nexis, why
return
else
if(!linked_account)
visible_message("<span class='warning'>The machine buzzes, and flashes \"NO LINKED ACCOUNT\" on the screen.</span>","You hear a buzz.")
flick(src,"pos-error")
return
if(screen!=POS_SCREEN_FINALIZE)
visible_message("<span class='notice'>The machine buzzes.</span>","<span class='warning'>You hear a buzz.</span>")
flick(src,"pos-error")
return
var/datum/money_account/acct = get_card_account(I)
if(!acct)
visible_message("<span class='warning'>The machine buzzes, and flashes \"NO ACCOUNT\" on the screen.</span>","You hear a buzz.")
flick(src,"pos-error")
return
if(credits_needed > acct.money)
visible_message("<span class='warning'>The machine buzzes, and flashes \"NOT ENOUGH FUNDS\" on the screen.</span>","You hear a buzz.")
flick(src,"pos-error")
return
visible_message("<span class='notice'>The machine beeps, and begins printing a receipt</span>","You hear a beep.")
PrintReceipt()
NewOrder()
acct.charge(credits_needed,linked_account,"Purchase at POS #[id].")
credits_needed=0
screen=POS_SCREEN_ORDER
else if(istype(A, /obj/item/stack/spacecash))
if(!linked_account)
visible_message("<span class='warning'>The machine buzzes, and flashes \"NO LINKED ACCOUNT\" on the screen.</span>","You hear a buzz.")
flick(src,"pos-error")
return
if(!logged_in || screen!=POS_SCREEN_FINALIZE)
visible_message("<span class='notice'>The machine buzzes.</span>","<span class='warning'>You hear a buzz.</span>")
flick(src,"pos-error")
return
var/obj/item/stack/spacecash/C = A
credits_held += C.amount
if(credits_held >= credits_needed)
visible_message("<span class='notice'>The machine beeps, and begins printing a receipt</span>","You hear a beep and the sound of paper being shredded.")
PrintReceipt()
NewOrder()
credits_held -= credits_needed
credits_needed=0
screen=POS_SCREEN_ORDER
if(credits_held)
new /obj/item/stack/spacecash(loc, credits_held)
credits_held=0
return
return ..()
+8 -10
View File
@@ -469,8 +469,8 @@
#include "code\game\world.dm"
#include "code\game\area\ai_monitored.dm"
#include "code\game\area\areas.dm"
#include "code\game\area\Dynamic areas.dm"
#include "code\game\area\Space Station 13 areas.dm"
#include "code\game\area\dynamic_areas.dm"
#include "code\game\area\ss13_areas.dm"
#include "code\game\area\areas\depot-areas.dm"
#include "code\game\area\areas\mining.dm"
#include "code\game\area\areas\ruins\lavaland.dm"
@@ -548,7 +548,7 @@
#include "code\game\gamemodes\devil\game_mode.dm"
#include "code\game\gamemodes\devil\objectives.dm"
#include "code\game\gamemodes\devil\contracts\friend.dm"
#include "code\game\gamemodes\devil\devil agent\devil_agent.dm"
#include "code\game\gamemodes\devil\devil_agent\devil_agent.dm"
#include "code\game\gamemodes\devil\imp\imp.dm"
#include "code\game\gamemodes\devil\true_devil\_true_devil.dm"
#include "code\game\gamemodes\devil\true_devil\inventory.dm"
@@ -963,7 +963,6 @@
#include "code\game\objects\items\weapons\dnascrambler.dm"
#include "code\game\objects\items\weapons\explosives.dm"
#include "code\game\objects\items\weapons\extinguisher.dm"
#include "code\game\objects\items\weapons\fireworks.dm"
#include "code\game\objects\items\weapons\flamethrower.dm"
#include "code\game\objects\items\weapons\garrote.dm"
#include "code\game\objects\items\weapons\gift_wrappaper.dm"
@@ -1202,7 +1201,7 @@
#include "code\modules\admin\stickyban.dm"
#include "code\modules\admin\topic.dm"
#include "code\modules\admin\watchlist.dm"
#include "code\modules\admin\DB ban\functions.dm"
#include "code\modules\admin\db_ban\functions.dm"
#include "code\modules\admin\permissionverbs\permissionedit.dm"
#include "code\modules\admin\tickets\adminticketsverbs.dm"
#include "code\modules\admin\tickets\mentorticketsverbs.dm"
@@ -1324,8 +1323,8 @@
#include "code\modules\buildmode\submodes\throwing.dm"
#include "code\modules\buildmode\submodes\variable_edit.dm"
#include "code\modules\client\asset_cache.dm"
#include "code\modules\client\client defines.dm"
#include "code\modules\client\client procs.dm"
#include "code\modules\client\client_defines.dm"
#include "code\modules\client\client_procs.dm"
#include "code\modules\client\message.dm"
#include "code\modules\client\view.dm"
#include "code\modules\client\preference\preferences.dm"
@@ -1430,7 +1429,6 @@
#include "code\modules\economy\Economy_TradeDestinations.dm"
#include "code\modules\economy\EFTPOS.dm"
#include "code\modules\economy\Job_Departments.dm"
#include "code\modules\economy\POS.dm"
#include "code\modules\economy\utils.dm"
#include "code\modules\error_handler\error_handler.dm"
#include "code\modules\error_handler\error_viewer.dm"
@@ -2341,8 +2339,8 @@
#include "code\modules\ruins\lavalandruin_code\syndicate_base.dm"
#include "code\modules\ruins\objects_and_mobs\gym.dm"
#include "code\modules\ruins\objects_and_mobs\necropolis_gate.dm"
#include "code\modules\security_levels\keycard authentication.dm"
#include "code\modules\security_levels\security levels.dm"
#include "code\modules\security_levels\keycard_authentication.dm"
#include "code\modules\security_levels\security_levels.dm"
#include "code\modules\shuttle\assault_pod.dm"
#include "code\modules\shuttle\emergency.dm"
#include "code\modules\shuttle\ert.dm"
@@ -1,20 +0,0 @@

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnstandardnessTestForDM", "UnstandardnessTestForDM\UnstandardnessTestForDM.csproj", "{A0EEBFC9-41D4-474D-853D-126AFDFB82DE}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x86 = Debug|x86
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{A0EEBFC9-41D4-474D-853D-126AFDFB82DE}.Debug|x86.ActiveCfg = Debug|x86
{A0EEBFC9-41D4-474D-853D-126AFDFB82DE}.Debug|x86.Build.0 = Debug|x86
{A0EEBFC9-41D4-474D-853D-126AFDFB82DE}.Release|x86.ActiveCfg = Release|x86
{A0EEBFC9-41D4-474D-853D-126AFDFB82DE}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
@@ -1,160 +0,0 @@
namespace UnstandardnessTestForDM
{
partial class Form1
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.button1 = new System.Windows.Forms.Button();
this.listBox1 = new System.Windows.Forms.ListBox();
this.panel1 = new System.Windows.Forms.Panel();
this.listBox2 = new System.Windows.Forms.ListBox();
this.label4 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label();
this.panel1.SuspendLayout();
this.SuspendLayout();
//
// button1
//
this.button1.Location = new System.Drawing.Point(12, 12);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(222, 23);
this.button1.TabIndex = 0;
this.button1.Text = "Locate all #defines";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// listBox1
//
this.listBox1.FormattingEnabled = true;
this.listBox1.Location = new System.Drawing.Point(12, 82);
this.listBox1.Name = "listBox1";
this.listBox1.Size = new System.Drawing.Size(696, 160);
this.listBox1.TabIndex = 1;
this.listBox1.SelectedIndexChanged += new System.EventHandler(this.listBox1_SelectedIndexChanged);
//
// panel1
//
this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.panel1.Controls.Add(this.listBox2);
this.panel1.Controls.Add(this.label4);
this.panel1.Controls.Add(this.label3);
this.panel1.Controls.Add(this.label2);
this.panel1.Controls.Add(this.label1);
this.panel1.Location = new System.Drawing.Point(12, 297);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(696, 244);
this.panel1.TabIndex = 2;
//
// listBox2
//
this.listBox2.FormattingEnabled = true;
this.listBox2.Location = new System.Drawing.Point(8, 71);
this.listBox2.Name = "listBox2";
this.listBox2.Size = new System.Drawing.Size(683, 160);
this.listBox2.TabIndex = 4;
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(5, 55);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(69, 13);
this.label4.TabIndex = 3;
this.label4.Text = "Referenced: ";
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(5, 42);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(40, 13);
this.label3.TabIndex = 2;
this.label3.Text = "Value: ";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(5, 29);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(61, 13);
this.label2.TabIndex = 1;
this.label2.Text = "Defined in: ";
//
// label1
//
this.label1.AutoSize = true;
this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.label1.Location = new System.Drawing.Point(3, 0);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(79, 29);
this.label1.TabIndex = 0;
this.label1.Text = "label1";
//
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(9, 38);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(81, 13);
this.label5.TabIndex = 3;
this.label5.Text = "Files searched: ";
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(720, 553);
this.Controls.Add(this.label5);
this.Controls.Add(this.panel1);
this.Controls.Add(this.listBox1);
this.Controls.Add(this.button1);
this.Name = "Form1";
this.Text = "Unstandardness Test For DM";
this.panel1.ResumeLayout(false);
this.panel1.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label1;
public System.Windows.Forms.ListBox listBox2;
public System.Windows.Forms.Label label5;
public System.Windows.Forms.ListBox listBox1;
}
}
@@ -1,484 +0,0 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Collections;
using System.IO;
namespace UnstandardnessTestForDM
{
public partial class Form1 : Form
{
DMSource source;
public Form1()
{
InitializeComponent();
source = new DMSource();
source.mainform = this;
}
private void button1_Click(object sender, EventArgs e)
{
source.find_all_defines();
generate_define_report();
}
public void generate_define_report()
{
TextWriter tw = new StreamWriter("DEFINES REPORT.txt");
tw.WriteLine("Unstandardness Test For DM report for DEFINES");
tw.WriteLine("Generated on " + DateTime.Now);
tw.WriteLine("Total number of defines " + source.defines.Count());
tw.WriteLine("Total number of Files " + source.filessearched);
tw.WriteLine("Total number of references " + source.totalreferences);
tw.WriteLine("Total number of errorous defines " + source.errordefines);
tw.WriteLine("------------------------------------------------");
foreach (Define d in source.defines)
{
tw.WriteLine(d.name);
tw.WriteLine("\tValue: " + d.value);
tw.WriteLine("\tComment: " + d.comment);
tw.WriteLine("\tDefined in: " + d.location + " : " + d.line);
tw.WriteLine("\tNumber of references: " + d.references.Count());
foreach (String s in d.references)
{
tw.WriteLine("\t\t" + s);
}
}
tw.WriteLine("------------------------------------------------");
tw.WriteLine("SUCCESS");
tw.Close();
}
private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
{
try
{
Define d = (Define)listBox1.Items[listBox1.SelectedIndex];
label1.Text = d.name;
label2.Text = "Defined in: " + d.location + " : " + d.line;
label3.Text = "Value: " + d.value;
label4.Text = "References: " + d.references.Count();
listBox2.Items.Clear();
foreach (String s in d.references)
{
listBox2.Items.Add(s);
}
}
catch (Exception ex) { Console.WriteLine("ERROR HERE: " + ex.Message); }
}
}
public class DMSource
{
public List<Define> defines;
public const int FLAG_DEFINE = 1;
public Form1 mainform;
public int filessearched = 0;
public int totalreferences = 0;
public int errordefines = 0;
public List<String> filenames;
public DMSource()
{
defines = new List<Define>();
filenames = new List<String>();
}
public void find_all_defines()
{
find_all_files();
foreach(String filename in filenames){
searchFileForDefines(filename);
}
}
public void find_all_files()
{
filenames = new List<String>();
String dmefilename = "";
foreach (string f in Directory.GetFiles("."))
{
if (f.ToLower().EndsWith(".dme"))
{
dmefilename = f;
break;
}
}
if (dmefilename.Equals(""))
{
MessageBox.Show("dme file not found");
return;
}
using (var reader = File.OpenText(dmefilename))
{
String s;
while (true)
{
s = reader.ReadLine();
if (!(s is String))
break;
if (s.StartsWith("#include"))
{
int start = s.IndexOf("\"")+1;
s = s.Substring(start, s.Length - 11);
if (s.EndsWith(".dm"))
{
filenames.Add(s);
}
}
s = s.Trim(' ');
if (s == "") { continue; }
}
reader.Close();
}
}
public void DirSearch(string sDir, int flag)
{
try
{
foreach (string d in Directory.GetDirectories(sDir))
{
foreach (string f in Directory.GetFiles(d))
{
if (f.ToLower().EndsWith(".dm"))
{
if ((flag & FLAG_DEFINE) > 0)
{
searchFileForDefines(f);
}
}
}
DirSearch(d, flag);
}
}
catch (System.Exception excpt)
{
Console.WriteLine("ERROR IN DIRSEARCH");
Console.WriteLine(excpt.Message);
Console.WriteLine(excpt.Data);
Console.WriteLine(excpt.ToString());
Console.WriteLine(excpt.StackTrace);
Console.WriteLine("END OF ERROR IN DIRSEARCH");
}
}
//DEFINES
public void searchFileForDefines(String fileName)
{
filessearched++;
FileInfo f = new FileInfo(fileName);
List<String> lines = new List<String>();
List<String> lines_without_comments = new List<String>();
mainform.label5.Text = "Files searched: " + filessearched + "; Defines found: " + defines.Count() + "; References found: " + totalreferences + "; Errorous defines: " + errordefines;
mainform.label5.Refresh();
//This code segment reads the file and stores it into the lines variable.
using (var reader = File.OpenText(fileName))
{
try
{
String s;
while (true)
{
s = reader.ReadLine();
lines.Add(s);
s = s.Trim(' ');
if (s == "") { continue; }
}
}
catch { }
reader.Close();
}
mainform.listBox1.Items.Add("ATTEMPTING: " + fileName);
lines_without_comments = remove_comments(lines);
/*TextWriter tw = new StreamWriter(fileName);
foreach (String s in lines_without_comments)
{
tw.WriteLine(s);
}
tw.Close();
mainform.listBox1.Items.Add("REWRITE: "+fileName);*/
try
{
for (int i = 0; i < lines_without_comments.Count; i++)
{
String line = lines_without_comments[i];
if (!(line is string))
continue;
//Console.WriteLine("LINE: " + line);
foreach (Define define in defines)
{
if (line.IndexOf(define.name) >= 0)
{
define.references.Add(fileName + " : " + i);
totalreferences++;
}
}
if( line.ToLower().IndexOf("#define") >= 0 )
{
line = line.Trim();
line = line.Replace('\t', ' ');
//Console.WriteLine("LINE = "+line);
String[] slist = line.Split(' ');
if(slist.Length >= 3){
//slist[0] has the value of "#define"
String name = slist[1];
String value = slist[2];
for (int j = 3; j < slist.Length; j++)
{
value += " " + slist[j];
//Console.WriteLine("LISTITEM["+j+"] = "+slist[j]);
}
value = value.Trim();
String comment = "";
if (value.IndexOf("//") >= 0)
{
comment = value.Substring(value.IndexOf("//"));
value = value.Substring(0, value.IndexOf("//"));
}
comment = comment.Trim();
value = value.Trim();
Define d = new Define(fileName,i,name,value,comment);
defines.Add(d);
mainform.listBox1.Items.Add(d);
mainform.listBox1.Refresh();
}else{
Define d = new Define(fileName, i, "ERROR ERROR", "Something went wrong here", line);
errordefines++;
defines.Add(d);
mainform.listBox1.Items.Add(d);
mainform.listBox1.Refresh();
}
}
}
}
catch (Exception e) {
Console.WriteLine(e.Message);
Console.WriteLine(e.StackTrace);
MessageBox.Show("Exception: " + e.Message + " | " + e.ToString());
}
}
bool iscomment = false;
int ismultilinecomment = 0;
bool isstring = false;
bool ismultilinestring = false;
int escapesequence = 0;
int stringvar = 0;
public List<String> remove_comments(List<String> lines)
{
List<String> r = new List<String>();
iscomment = false;
ismultilinecomment = 0;
isstring = false;
ismultilinestring = false;
bool skiponechar = false; //Used so the / in */ doesn't get written;
for (int i = 0; i < lines.Count(); i++)
{
String line = lines[i];
if (!(line is String))
continue;
iscomment = false;
isstring = false;
char ca = ' ';
escapesequence = 0;
String newline = "";
int k = line.Length;
for (int j = 0; j < k; j++)
{
char c = line.ToCharArray()[j];
if (escapesequence == 0)
if (normalstatus())
{
if (ca == '/' && c == '/')
{
c = ' ';
iscomment = true;
newline = newline.Remove(newline.Length - 1);
k = line.Length;
}
if (ca == '/' && c == '*')
{
c = ' ';
ismultilinecomment = 1;
newline = newline.Remove(newline.Length - 1);
k = line.Length;
}
if (c == '"')
{
isstring = true;
}
if (ca == '{' && c == '"')
{
ismultilinestring = true;
}
}
else if (isstring)
{
if (c == '\\')
{
escapesequence = 2;
}
else if (stringvar > 0)
{
if (c == ']')
{
stringvar--;
}
else if (c == '[')
{
stringvar++;
}
}
else if (c == '"')
{
isstring = false;
}
else if (c == '[')
{
stringvar++;
}
}
else if (ismultilinestring)
{
if (ca == '"' && c == '}')
{
ismultilinestring = false;
}
}
else if (ismultilinecomment > 0)
{
if (ca == '/' && c == '*')
{
c = ' '; //These things are here to prevent /*/ from bieng interpreted as the start and end of a comment.
skiponechar = true;
ismultilinecomment++;
}
if (ca == '*' && c == '/')
{
c = ' '; //These things are here to prevent /*/ from bieng interpreted as the start and end of a comment.
skiponechar = true;
ismultilinecomment--;
}
}
if (!iscomment && (ismultilinecomment==0) && !skiponechar)
{
newline += c;
}
if (skiponechar)
{
skiponechar = false;
}
if (escapesequence > 0)
{
escapesequence--;
}
else
{
ca = c;
}
}
r.Add(newline.TrimEnd());
}
return r;
}
private bool normalstatus()
{
return !isstring && !ismultilinestring && (ismultilinecomment==0) && !iscomment && (escapesequence == 0);
}
}
public class Define
{
public String location;
public int line;
public String name;
public String value;
public String comment;
public List<String> references;
public Define(String location, int line, String name, String value, String comment)
{
this.location = location;
this.line = line;
this.name = name;
this.value = value;
this.comment = comment;
this.references = new List<String>();
}
public override String ToString()
{
return "DEFINE: \""+name+"\" is defined as \""+value+"\" AT "+location+" : "+line;
}
}
}
@@ -1,120 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
@@ -1,21 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
namespace UnstandardnessTestForDM
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
}
}
@@ -1,36 +0,0 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("UnstandardnessTestForDM")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft")]
[assembly: AssemblyProduct("UnstandardnessTestForDM")]
[assembly: AssemblyCopyright("Copyright © Microsoft 2012")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("c0e09000-1840-4416-8bb2-d86a8227adf1")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
@@ -1,71 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.239
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace UnstandardnessTestForDM.Properties
{
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources
{
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources()
{
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager
{
get
{
if ((resourceMan == null))
{
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("UnstandardnessTestForDM.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture
{
get
{
return resourceCulture;
}
set
{
resourceCulture = value;
}
}
}
}
@@ -1,117 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
@@ -1,30 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.239
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace UnstandardnessTestForDM.Properties
{
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
{
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default
{
get
{
return defaultInstance;
}
}
}
}
@@ -1,7 +0,0 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>
@@ -1,87 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{A0EEBFC9-41D4-474D-853D-126AFDFB82DE}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>UnstandardnessTestForDM</RootNamespace>
<AssemblyName>UnstandardnessTestForDM</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<PlatformTarget>x86</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<PlatformTarget>x86</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Form1.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Form1.Designer.cs">
<DependentUpon>Form1.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="Form1.resx">
<DependentUpon>Form1.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
@@ -1,11 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity version="1.0.0.0" name="MyApplication.app"/>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
<requestedExecutionLevel level="asInvoker" uiAccess="false"/>
</requestedPrivileges>
</security>
</trustInfo>
</assembly>
@@ -1,18 +0,0 @@
c:\users\baloh\documents\visual studio 2010\Projects\UnstandardnessTestForDM\UnstandardnessTestForDM\bin\Debug\UnstandardnessTestForDM.exe
c:\users\baloh\documents\visual studio 2010\Projects\UnstandardnessTestForDM\UnstandardnessTestForDM\bin\Debug\UnstandardnessTestForDM.pdb
c:\users\baloh\documents\visual studio 2010\Projects\UnstandardnessTestForDM\UnstandardnessTestForDM\obj\x86\Debug\ResolveAssemblyReference.cache
c:\users\baloh\documents\visual studio 2010\Projects\UnstandardnessTestForDM\UnstandardnessTestForDM\obj\x86\Debug\UnstandardnessTestForDM.Form1.resources
c:\users\baloh\documents\visual studio 2010\Projects\UnstandardnessTestForDM\UnstandardnessTestForDM\obj\x86\Debug\UnstandardnessTestForDM.Properties.Resources.resources
c:\users\baloh\documents\visual studio 2010\Projects\UnstandardnessTestForDM\UnstandardnessTestForDM\obj\x86\Debug\GenerateResource.read.1.tlog
c:\users\baloh\documents\visual studio 2010\Projects\UnstandardnessTestForDM\UnstandardnessTestForDM\obj\x86\Debug\GenerateResource.write.1.tlog
c:\users\baloh\documents\visual studio 2010\Projects\UnstandardnessTestForDM\UnstandardnessTestForDM\obj\x86\Debug\UnstandardnessTestForDM.exe
c:\users\baloh\documents\visual studio 2010\Projects\UnstandardnessTestForDM\UnstandardnessTestForDM\obj\x86\Debug\UnstandardnessTestForDM.pdb
C:\Users\Baloh\Desktop\tgs13\tools\UnstandardnessTestForDM\UnstandardnessTestForDM\bin\Debug\UnstandardnessTestForDM.exe
C:\Users\Baloh\Desktop\tgs13\tools\UnstandardnessTestForDM\UnstandardnessTestForDM\bin\Debug\UnstandardnessTestForDM.pdb
C:\Users\Baloh\Desktop\tgs13\tools\UnstandardnessTestForDM\UnstandardnessTestForDM\obj\x86\Debug\ResolveAssemblyReference.cache
C:\Users\Baloh\Desktop\tgs13\tools\UnstandardnessTestForDM\UnstandardnessTestForDM\obj\x86\Debug\UnstandardnessTestForDM.Form1.resources
C:\Users\Baloh\Desktop\tgs13\tools\UnstandardnessTestForDM\UnstandardnessTestForDM\obj\x86\Debug\UnstandardnessTestForDM.Properties.Resources.resources
C:\Users\Baloh\Desktop\tgs13\tools\UnstandardnessTestForDM\UnstandardnessTestForDM\obj\x86\Debug\GenerateResource.read.1.tlog
C:\Users\Baloh\Desktop\tgs13\tools\UnstandardnessTestForDM\UnstandardnessTestForDM\obj\x86\Debug\GenerateResource.write.1.tlog
C:\Users\Baloh\Desktop\tgs13\tools\UnstandardnessTestForDM\UnstandardnessTestForDM\obj\x86\Debug\UnstandardnessTestForDM.exe
C:\Users\Baloh\Desktop\tgs13\tools\UnstandardnessTestForDM\UnstandardnessTestForDM\obj\x86\Debug\UnstandardnessTestForDM.pdb